当前位置: 首页>>代码示例>>Java>>正文


Java Point.measurement方法代码示例

本文整理汇总了Java中org.influxdb.dto.Point.measurement方法的典型用法代码示例。如果您正苦于以下问题:Java Point.measurement方法的具体用法?Java Point.measurement怎么用?Java Point.measurement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.influxdb.dto.Point的用法示例。


在下文中一共展示了Point.measurement方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toDBPoint

import org.influxdb.dto.Point; //导入方法依赖的package包/类
/**
 * Create an InfluxDB Point that can be saved into InfluxDB database
 *
 * @return point
 */
public Point toDBPoint() {
    // get tags without nulls
    Map tags = getObjectTags();
    removeNullValues(tags);

    // get fields without nulls
    Map fields = getObjectFields();
    removeNullValues(fields);

    // start building DB Point
    Point.Builder builder = Point.measurement(getMeasurementName());

    Long time = getTime();
    if (time != null && time > 0) {
        builder = builder.time(time, TimeUnit.MILLISECONDS);
    }

    // finish up and return constructed DB point
    return builder.tag(tags).fields(fields).build();
}
 
开发者ID:icclab,项目名称:cyclops-udr,代码行数:26,代码来源:DTOObject.java

示例2: process

import org.influxdb.dto.Point; //导入方法依赖的package包/类
/**
   * Procses a Telegraf message received over Kafka.
   *
   * @param msg The msg to process.
   */
  public void process(String msg) {
    TelegrafMeasure measure = parse(msg);
    Point.Builder builder = Point.measurement(measure.name);
    for (Map.Entry<String, String> entry : measure.tags.entrySet()) {
      builder.tag(entry.getKey(), entry.getValue());
    }
    setValue(builder, measure);
    Point point = builder.build();
//    log.trace("Writing to InFlux:"+point);
    db.write(dbName, "default", point);
    count++;
    if (count % 100 == 0) System.out.print(count + ",");
    if (count % 1000 == 0) System.out.println();
  }
 
开发者ID:mukatee,项目名称:kafka-consumer,代码行数:20,代码来源:InFluxTelegrafConsumer.java

示例3: multiPoint

import org.influxdb.dto.Point; //导入方法依赖的package包/类
private void multiPoint(long time, JsonObject header, JsonObject body) {
  for (JsonObject.Member member : body) {
    String name = member.getName();
    Point.Builder builder = Point.measurement(name);
    builder.time(time, TimeUnit.MILLISECONDS);
    setTags(header, builder);
    setField("value", builder, member.getValue());
    Point point = builder.build();
    db.write(dbName, "default", point);
  }
}
 
开发者ID:mukatee,项目名称:kafka-consumer,代码行数:12,代码来源:InFluxJSONConsumer.java

示例4: singlePoint

import org.influxdb.dto.Point; //导入方法依赖的package包/类
private void singlePoint(String type, long time, JsonObject header, JsonObject body) {
  Point.Builder builder = Point.measurement(type);
  builder.time(time, TimeUnit.MILLISECONDS);
  setTags(header, builder);
  createFields(body, builder);
  Point point = builder.build();
  System.out.println("writing point:" + point);
  db.write(dbName, "default", point);
}
 
开发者ID:mukatee,项目名称:kafka-consumer,代码行数:10,代码来源:InFluxJSONConsumer.java


注:本文中的org.influxdb.dto.Point.measurement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。