Package net.opentsdb.core

Examples of net.opentsdb.core.IncomingDataPoint


    // convert to a string so we can handle character encoding properly
    final String content = query.getContent().trim();
    final int firstbyte = content.charAt(0);
    try {
      if (firstbyte == '{') {
        final IncomingDataPoint dp =
          JSON.parseToObject(content, IncomingDataPoint.class);
        final ArrayList<IncomingDataPoint> dps =
          new ArrayList<IncomingDataPoint>(1);
        dps.add(dp);
        return dps;
View Full Code Here


     */
    @Override
    public void record(final String name, final long value,
        final String xtratag) {
     
      final IncomingDataPoint dp = new IncomingDataPoint();
      dp.setMetric(prefix + "." + name);
      dp.setTimestamp(System.currentTimeMillis() / 1000L);
      dp.setValue(Long.toString(value));
     
      String tagk = "";
      if (xtratag != null) {
        if (xtratag.indexOf('=') != xtratag.lastIndexOf('=')) {
          throw new IllegalArgumentException("invalid xtratag: " + xtratag
              + " (multiple '=' signs), name=" + name + ", value=" + value);
        } else if (xtratag.indexOf('=') < 0) {
          throw new IllegalArgumentException("invalid xtratag: " + xtratag
              + " (missing '=' signs), name=" + name + ", value=" + value);
        }
        final String[] pair = xtratag.split("=");
        tagk = pair[0];
        addExtraTag(tagk, pair[1]);
      }
     
      addHostTag(canonical);
    
      final HashMap<String, String> tags =
        new HashMap<String, String>(extratags);
      dp.setTags(tags);
      dps.add(dp);
     
      if (!tagk.isEmpty()) {
        clearExtraTag(tagk);
      }
View Full Code Here

TOP

Related Classes of net.opentsdb.core.IncomingDataPoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.