forked from I2P_Developers/i2p.i2p
Replace old jrobin with rrd4j 3.5 (ticket #2684)
2019-02-10 From https://github.com/rrd4j/rrd4j/releases Copyright (c) 2001-2005 Sasa Markovic and Ciaran Treanor. Copyright (c) 2011 The OpenNMS Group, Inc. Copyright 2011 The RRD4J Authors. Apache 2.0 and LGPLv2.1 Unmodified as a base for future merges, except for omitted files listed below. This rev will not work; font patch to follow in next revision. Following directories and files omitted: converter/ core/RrdBerkeleyDbBackendFactory.java core/RrdBerkeleyDbBackend.java core/RrdMongoDBBackendFactory.java core/RrdMongoDBBackend.java demo/ graph/RrdGraphDefTemplate.java inspector/ eu/bengreen/data/utility/
This commit is contained in:
59
apps/jrobin/java/src/org/rrd4j/data/Source.java
Normal file
59
apps/jrobin/java/src/org/rrd4j/data/Source.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package org.rrd4j.data;
|
||||
|
||||
abstract class Source {
|
||||
private final String name;
|
||||
|
||||
protected double[] values;
|
||||
protected long[] timestamps;
|
||||
|
||||
Source(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
void setValues(double[] values) {
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
void setTimestamps(long[] timestamps) {
|
||||
this.timestamps = timestamps;
|
||||
}
|
||||
|
||||
double[] getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
long[] getTimestamps() {
|
||||
return timestamps;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tStart
|
||||
* @param tEnd
|
||||
* @return
|
||||
* @deprecated This method is deprecated. Uses instance of {@link org.rrd4j.data.Variable}, used with {@link org.rrd4j.data.DataProcessor.addDatasource(String, String, Variable)}
|
||||
*/
|
||||
@Deprecated
|
||||
Aggregates getAggregates(long tStart, long tEnd) {
|
||||
Aggregator agg = new Aggregator(timestamps, values);
|
||||
return agg.getAggregates(tStart, tEnd);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tStart
|
||||
* @param tEnd
|
||||
* @param percentile
|
||||
* @return
|
||||
* @deprecated This method is deprecated. Uses instance of {@link org.rrd4j.data.Variable.PERCENTILE}, used with {@link org.rrd4j.data.DataProcessor.addDatasource(String, String, Variable)}
|
||||
*/
|
||||
@Deprecated
|
||||
double getPercentile(long tStart, long tEnd, double percentile) {
|
||||
Variable vpercent = new Variable.PERCENTILE((float) percentile);
|
||||
vpercent.calculate(this, tStart, tEnd);
|
||||
return vpercent.getValue().value;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user