Adds a single data point to the given counter.
@param tenantId
@param counterId
@param timestamp
@param value
342337
public DataPointLongBean addCounterDataPoint(String tenantId, String counterId, Date timestamp, long value) {
        List<DataPointLongBean> dataPoints = new ArrayList<>();
        DataPointLongBean dataPoint = new DataPointLongBean(timestamp, value);
        dataPoints.add(dataPoint);
        addCounterDataPoints(tenantId, counterId, dataPoints);
        return dataPoint;
    }
927137
@SuppressWarnings("nls")
    public List<BucketDataPointBean> getCounterData(String tenantId, String counterId, Date from, Date to,
            BucketSizeType bucketSize) {
        try {
            StringBuilder params = new StringBuilder();
            params.append("?")
                .append("start=")
                .append(from.getTime())
                .append("&end=")
                .append(to.getTime())
                .append("&bucketDuration=")
                .append(bucketSize.getValue());
            URL endpoint = serverUrl.toURI().resolve("counters/" + counterId + "/stats" + params.toString()).toURL(); //$NON-NLS-1$
            Request request = new Request.Builder()
                    .url(endpoint)
                    .header("Accept", "application/json") //$NON-NLS-1$ //$NON-NLS-2$
                    .header("Hawkular-Tenant", tenantId) //$NON-NLS-1$
                    .build();
            Response response = httpClient.newCall(request).execute();
            if (response.code() >= 400) {
                throw hawkularMetricsError(response);
            }
            if (response.code() == 204) {
                return Collections.EMPTY_LIST;
            }
            String responseBody = response.body().string();
            return readMapper.reader(new TypeReference<List<BucketDataPointBean>>() {}).readValue(responseBody);
        } catch (URISyntaxException | IOException e) {
            throw new RuntimeException(e);
        }
    }
1076866
public Datapoint addLongValue(long time, long value) {
        initialValues();
        checkType(TsdbConstants.TYPE_LONG);

        values.add(Lists.<JsonNode> newArrayList(new LongNode(time), new LongNode(value)));
        return this;
    }
283834
public void set(boolean value, int entry) {
        if (entry > numEntries || entry < 0)
            throw new ND4JIllegalStateException(
                            "Entry index given (" + entry + ")in is higher then configured one (" + numEntries + ")");

        if (oneTime && this.timeTracker.get(entry))
            return;

        if (value)
            this.holder |= 1 << (entry + 1);
        else
            this.holder &= ~(1 << (entry + 1));

        if (oneTime)
            this.timeTracker.set(true, entry);
    }
156101
public static void addProperty(String key, String value) {
    TransactionLogger instance = getInstance();
    if (instance != null) {
      instance.properties.put(key, value);
    }
  }
1121612
public void timestamp(String name, ZonedDateTime value) {
		Counter counter = get(name, CounterType.Timestamp);
		counter.setTime(value != null ? value : ZonedDateTime.now(ZoneId.of("Z")));
		update();
	}
440425
synchronized Lease addLease(String holder, String src, long timestamp) {
    Lease lease = getLease(holder);
    if (lease == null) {
      lease = new Lease(holder);
      leases.put(holder, lease);
      sortedLeases.add(lease);
    } else {
      renewLease(lease);
    }
    sortedLeasesByPath.put(src, new LeaseOpenTime(lease, timestamp));
    lease.paths.add(src);

    return lease;
  }
50936
public void add(long timestamp, T object) {
		JMMap.getOrPutGetNew(this.timeSeriesMap, buildKeyTimestamp(timestamp),
				ArrayList::new).add(object);
	}
372688
synchronized void addDataPoint(double value, int updated) {
        // 8/10/2012: Force the standard deviation to 1/3 of the first data point
        // 8/11:2012: Force it to 1/6th of the first data point (more accurate)
        if (ewmaVariance == Double.NEGATIVE_INFINITY) {
            reset(value, updated);
            return;
        }

        double delta = value - ewma;
        double increment = ALPHA * delta;

        ewma += increment;
        ewmaVariance = (1 - ALPHA) * (ewmaVariance + delta * increment);
        ewmaStddev = Math.sqrt(ewmaVariance);

        lastUpdate = updated;
    }
598569
private void putDataPoint(final int i, final HistogramDataPoint dp) {
    timestamps[i] = dp.timestamp();
    values[i] = dp.clone();
  }
888473
public void addCounterColumn(ByteBuffer name, long value) throws IOException
    {
        addColumn(new BufferCounterCell(metadata.comparator.cellFromByteBuffer(name),
                                        CounterContext.instance().createGlobal(counterid, 1L, value),
                                        System.currentTimeMillis()));
    }
310999
public void add (Object value)
    {
        _list[_lastPos++ % _list.length] = value;
        // keep last pos cycling from keepCount to 2*keepCount-1
        if (_lastPos == 2*_list.length) {
            _lastPos = _list.length;
        }
    }
442509
public void createTenant(String tenantId) {
        TenantBean tenant = new TenantBean(tenantId);
        try {
            URL endpoint = serverUrl.toURI().resolve("tenants").toURL(); //$NON-NLS-1$
            Request request = new Request.Builder()
                    .url(endpoint)
                    .post(toBody(tenant))
                    .header("Hawkular-Tenant", tenantId) //$NON-NLS-1$
                    .build();
            Response response = httpClient.newCall(request).execute();
            if (response.code() >= 400) {
                throw hawkularMetricsError(response);
            }
        } catch (URISyntaxException | IOException e) {
            throw new RuntimeException(e);
        }
    }
1236744
public void remove(String tenantId, String triggerId) {
        if (tenantId == null) {
            throw new IllegalArgumentException("tenantId must be not null");
        }
        if (triggerId == null) {
            throw new IllegalArgumentException("triggerId must be not null");
        }
        Set<DataEntry> dataEntriesToRemove = new HashSet<>();
        activeDataEntries.stream().forEach(e -> {
            if (e.getTenantId().equals(tenantId) && e.getTriggerId().equals(triggerId)) {
                dataEntriesToRemove.add(e);
            }
        });
        activeDataEntries.removeAll(dataEntriesToRemove);
        Set<DataId> dataIdToCheck = new HashSet<>();
        dataEntriesToRemove.stream().forEach(e -> {
            dataIdToCheck.add(new DataId(e.getTenantId(), e.getDataId()));
        });
        Set<DataId> dataIdToRemove = new HashSet<>();
        dataIdToCheck.stream().forEach(dataId -> {
            boolean found = false;
            for (DataEntry entry : activeDataEntries) {
                DataId currentDataId = new DataId(entry.getTenantId(), entry.getDataId());
                if (currentDataId.equals(dataId)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                dataIdToRemove.add(dataId);
            }
        });
        activeDataIds.removeAll(dataIdToRemove);
    }
131672
public void add(final String key, final String value)
	{
		data.setProperty(key, value);
		fireTableDataChanged();
	}
860852
public void add(DataEntry dataEntry) {
        activeDataEntries.add(dataEntry);
        DataId newDataId = new DataId(dataEntry.getTenantId(), dataEntry.getDataId());
        if (!activeDataIds.contains(newDataId)) {
            activeDataIds.add(newDataId);
        }
    }
921171
void addValue(String columnName, String value)
    {
        addValue(columnNames.indexOf(columnName), value);
    }