Adds a single data point to the metric.
@param timestamp
@param value
@param tags
777947
public DataPointLongBean addDataPoint(Date timestamp, long value, Map<String, String> tags) {
        DataPointLongBean point = new DataPointLongBean(timestamp, value);
        for (Entry<String, String> entry : tags.entrySet()) {
            point.addTag(entry.getKey(), entry.getValue());
        }
        dataPoints.add(point);
        return point;
    }
661873
public void setTags(java.util.Collection<String> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new java.util.ArrayList<String>(tags);
    }
250598
private void putDataPoint(final int i, final DataPoint dp) {
    timestamps[i] = dp.timestamp();
    if (dp.isInteger()) {
      //LOG.debug("Putting #" + i + " (long) " + dp.longValue()
      //          + " @ time " + dp.timestamp());
      values[i] = dp.longValue();
    } else {
      //LOG.debug("Putting #" + i + " (double) " + dp.doubleValue()
      //          + " @ time " + dp.timestamp());
      values[i] = Double.doubleToRawLongBits(dp.doubleValue());
      timestamps[i] |= FLAG_FLOAT;
    }
  }
140938
private void updateTagData(Map<Poi, Map<String, String>> pois, String key, String value) {
        for (Map.Entry<Poi, Map<String, String>> entry : pois.entrySet()) {
            Poi poi = entry.getKey();
            String tmpValue = value;

            Map<String, String> tagmap = entry.getValue();
            if (!tagmap.keySet().contains("name")) {
                continue;
            }

            if (tagmap.keySet().contains(key)) {
                // Process is_in tags
                if (!key.equals("is_in")) {
                    continue;
                }
                String prev = tagmap.get(key);
                // Continue if tag already set correctly
                if (prev.contains(",") || prev.contains(";")) {
                    continue;
                }
                // If string is a correct value, append it to existent value;
                if (tmpValue.contains(",") || tmpValue.contains(";")) {
                    tmpValue = (prev + "," + tmpValue);
                }
            }

            //Write surrounding area as parent in "is_in" tag.
            tagmap.put(key, tmpValue);
            try {
                this.pStmtUpdateData.setLong(2, poi.id);
                this.pStmtUpdateData.setString(1, writer.tagsToString(tagmap));

                this.pStmtUpdateData.addBatch();

                batchCountRelation++;
                if (batchCountRelation % PoiWriter.BATCH_LIMIT == 0) {
                    pStmtUpdateData.executeBatch();
                    pStmtUpdateData.clearBatch();
                    writer.conn.commit();
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
157139
public void setTags(java.util.Collection<Tag> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new java.util.ArrayList<Tag>(tags);
    }
373124
@Override
    public final <T extends TimePoint<? super U, T>> T addTo(T time) {

        return this.add(time, this, false);

    }
571335
public void addSplit(long timestampInMs, long durationInNs) {
		last = durationInNs;
		total += durationInNs;
		squareTotal += durationInNs * durationInNs;
		if (durationInNs > max) {
			max = durationInNs;
		}
		if (durationInNs < min) {
			min = durationInNs;
		}
		counter++;
		lastTimestamp = timestampInMs;
	}
16262
private Deferred<Object> addPointInternal(final long timestamp,
      final byte[] value, final short flags) throws IllegalDataException {
    final boolean ms_timestamp = (timestamp & Const.SECOND_MASK) != 0;

    // we only accept unix epoch timestamps in seconds or milliseconds
    if (timestamp < 0 || (ms_timestamp && timestamp > 9999999999999L)) {
      throw new IllegalArgumentException((timestamp < 0 ? "negative " : "bad")
          + " timestamp=" + timestamp
          + " when trying to add value=" + Arrays.toString(value) + " to " + this);
    }

    // always maintain lastTimestamp in milliseconds
    if ((ms_timestamp ? timestamp : timestamp * 1000) <= last_timestamp) {
      throw new IllegalArgumentException("New timestamp=" + timestamp
          + " is less than or equal to previous=" + last_timestamp
          + " when trying to add value=" + Arrays.toString(value)
          + " to " + this);
    }
    last_timestamp = (ms_timestamp ? timestamp : timestamp * 1000);

    long incomingBaseTime;
    if (ms_timestamp) {
      // drop the ms timestamp to seconds to calculate the base timestamp
      incomingBaseTime = 
          ((timestamp / 1000) - ((timestamp / 1000) % Const.MAX_TIMESPAN));
    }
    else {
      incomingBaseTime = (timestamp - (timestamp % Const.MAX_TIMESPAN));
    }

    /**
     * First time we add a point initialize the rows timestamp.
     */
    if (base_time == Long.MIN_VALUE) {
      base_time = incomingBaseTime;
      Bytes.setInt(row_key, (int) base_time, 
          tsdb.metrics.width() + Const.SALT_WIDTH());
    }

    if (incomingBaseTime - base_time >= Const.MAX_TIMESPAN) {
      throw new IllegalDataException(
          "The timestamp is beyond the boundary of this batch of data points");
    }
    if (incomingBaseTime < base_time) {
      throw new IllegalDataException(
          "The timestamp is prior to the boundary of this batch of data points");
    }

    // Java is so stupid with its auto-promotion of int to float.
    final byte[] new_qualifier = Internal.buildQualifier(timestamp, flags);

    // compact this data point with the previously compacted data points.
    append(new_qualifier, value);
    size++;

    /**
     * Satisfies the interface.
     */
    return Deferred.fromResult((Object) null);
  }
433363
public void add(long readyTs, T value) {
        Object[] values = delayed.get(readyTs);

        // if one or more objects is already scheduled for given time
        if (values != null) {
            // make a list
            Object[] values2 = new Object[values.length + 1];
            values2[0] = value;
            for (int i = 0; i < values.length; i++) {
                values2[i + 1] = values[i];
            }
            values = values2;
        }
        else {
            values = new Object[] { value };
        }
        delayed.put(readyTs, values);
        m_size++;
    }
472152
public void setMetricData(java.util.Collection<MetricDatapoint> metricData) {
        if (metricData == null) {
            this.metricData = null;
            return;
        }

        this.metricData = new java.util.ArrayList<MetricDatapoint>(metricData);
    }
500573
public void addData(double xOffset, double yOffset, String label) {

    DataPoint dp = new DataPoint(xOffset, yOffset, label);
    dataPointList.add(dp);
  }
540555
void record(
      List</*@Nullable*/ TagValue> tagValues,
      double value,
      Map<String, AttachmentValue> attachments,
      Timestamp timestamp) {
    if (!tagValueAggregationMap.containsKey(tagValues)) {
      tagValueAggregationMap.put(
          tagValues, RecordUtils.createMutableAggregation(aggregation, measure));
    }
    tagValueAggregationMap.get(tagValues).add(value, attachments, timestamp);
  }
937996
def append(txn, metrics)
      timestamp   = txn.root_segment.stop_time
      series_name = txn.custom_series_name || (txn.web? ? 'app' : 'job')
      values      = Hash.new { |h, k| h[k] = 0 }

      tags = txn.tags || {}
      tags[:endpoint] = txn.scope

      metrics.each do |meta, stat|
        if ROOT_METRICS.key?(meta.type)
          time_key, count_key = ROOT_METRICS[meta.type]

          values[time_key]  += stat.total_exclusive_time
          values[count_key] += stat.call_count
        else
          values['ruby_time'] += stat.total_exclusive_time
        end

        values['total_time'] += stat.total_exclusive_time
      end

      values['latency'] = txn.annotations[:latency] if txn.annotations[:latency]

      # Segment time are in seconds, store them in milliseconds
      values.transform_values! { |v| v.is_a?(Integer) ? v : v * 1000 }

      @points << {
        series: series_name,
        timestamp: (timestamp * 1000).to_i,
        tags: tags,
        values: values
      }
    end
582477
public void setDate(int tagType, @NotNull java.util.Date value)
    {
        setObject(tagType, value);
    }
333879
public void setTagValue(String name, long value) {
        removeTag(name);
        XtraTag tag = new XtraTag(name);
        tag.values.addElement(new XtraValue(value));
        tags.addElement(tag);
    }
369314
@Weight(value = Weight.Unit.VARIABLE, comment = "Depends on the current call stack depth")
  // WARNING! Don't make a call from methods of the class to not break stack depth!
  public static void addPoint(@Nonnull final String timePointName, @Nonnull final TimeAlertListener listener) {
    final List<TimeData> list = REGISTRY.get();
    list.add(new TimeData(ThreadUtils.stackDepth(), timePointName, -1L, assertNotNull(listener)));
  }
1337928
public Datapoint addStringValue(long time, String value) {
        initialValues();
        checkType(TsdbConstants.TYPE_STRING);

        values.add(Lists.<JsonNode> newArrayList(new LongNode(time), new TextNode(value)));
        return this;
    }