本文整理汇总了Java中org.rrd4j.core.Sample类的典型用法代码示例。如果您正苦于以下问题:Java Sample类的具体用法?Java Sample怎么用?Java Sample使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Sample类属于org.rrd4j.core包,在下文中一共展示了Sample类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onMessage
import org.rrd4j.core.Sample; //导入依赖的package包/类
@Override
public synchronized void onMessage(TelemetryMessage message) {
try {
LOGGER.info("onMessage: message[{}]", message);
Sample sample = rrdDb.createSample();
sample.setTime(message.getSampleTime());
sample.setValue("speed", message.getSpeed());
sample.setValue("odometer", message.getOdometerReading());
sample.setValue("batteryPercent", message.getBatteryPercent());
sample.setValue("elevation", message.getElevation());
sample.setValue("estHeading", message.getEstHeading());
sample.setValue("heading", message.getHeading());
sample.setValue("latitude", message.getLatitude());
sample.setValue("longitude", message.getLongitude());
sample.setValue("power", message.getPower());
sample.setValue("ratedRange", message.getRatedRange());
sample.setValue("estRange", message.getEstRange());
sample.update();
} catch (IOException ex) {
LOGGER.error("onMessage: Unable to process message.", ex);
}
}
开发者ID:avirtuos,项目名称:teslog,代码行数:24,代码来源:RrdTelemetryStore.java
示例2: store
import org.rrd4j.core.Sample; //导入依赖的package包/类
public static void store(List<Integer> data, RrdDb db) {
StringBuilder sb = new StringBuilder();
for (Integer value : data) {
sb.append(value);
sb.append(':');
}
sb.deleteCharAt(sb.length() - 1);
try {
Sample sample = db.createSample();
sample.setAndUpdate(sb.toString());
} catch (IOException ex) {
Logger.getLogger(RrdHelper.class.getName()).log(Level.SEVERE, null, ex);
}
}
开发者ID:roscisz,项目名称:KernelHive,代码行数:16,代码来源:RrdHelper.java
示例3: updateSREventCountGraph
import org.rrd4j.core.Sample; //导入依赖的package包/类
private final void updateSREventCountGraph(RrdDb rrdDb){
try {
Sample sample = rrdDb.createSample();
int j = studentRecordsService.eventCount().getEventCount();
sample.setAndUpdate("NOW:" + j);
rrdDb.close();
} catch (IOException e) {
System.out.println(e);
}
}
开发者ID:AdamHansrod,项目名称:Graphr,代码行数:11,代码来源:RRD.java
示例4: updateMoodleGraph
import org.rrd4j.core.Sample; //导入依赖的package包/类
private final void updateMoodleGraph(RrdDb rrdDb){
try {
Sample sample = rrdDb.createSample();
int j = moodleService.moodleUsers().getMoodleUsersCount();
sample.setAndUpdate("NOW:" + j);
rrdDb.close();
} catch (IOException e) {
System.out.println(e);
}
}
开发者ID:AdamHansrod,项目名称:Graphr,代码行数:11,代码来源:RRD.java
示例5: logIntoRRD
import org.rrd4j.core.Sample; //导入依赖的package包/类
private void logIntoRRD(RrdDb rrdDb, Double value) throws IOException {
Sample sample = rrdDb.createSample();
sample.setValue(name, value);
sample.update();
rrdDb.close();
}
开发者ID:SebiGo,项目名称:BrewControlServer,代码行数:7,代码来源:RRD.java
注:本文中的org.rrd4j.core.Sample类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论