Go from millisec. to sec. precision in influx timestamps.
Do not go to minNumberOfSamples at first processing.
This commit is contained in:
parent
fb5bfd532b
commit
1b5a91c776
|
@ -117,7 +117,7 @@ public final class InfluxClient {
|
|||
measurements.forEach( (m) -> {
|
||||
|
||||
Point.Builder builder = Point.measurement(name)
|
||||
.time(timestamp.toEpochMilli(), TimeUnit.MILLISECONDS)
|
||||
.time(timestamp.getEpochSecond(), TimeUnit.SECONDS)
|
||||
.tag(m.tags)
|
||||
.fields(m.fields);
|
||||
|
||||
|
@ -133,7 +133,7 @@ public final class InfluxClient {
|
|||
measurements.forEach( (m) -> {
|
||||
log.trace("processMeasurementMap() - timestamp: {}, tags: {}, fields: {}", m.timestamp, m.tags, m.fields);
|
||||
Point.Builder builder = Point.measurement(name)
|
||||
.time(m.timestamp.toEpochMilli(), TimeUnit.MILLISECONDS)
|
||||
.time(m.timestamp.getEpochSecond(), TimeUnit.SECONDS)
|
||||
.tag(m.tags)
|
||||
.fields(m.fields);
|
||||
listOfPoints.add(builder.build());
|
||||
|
|
|
@ -124,9 +124,9 @@ public abstract class Resource {
|
|||
sampleHistory.remove(0);
|
||||
}
|
||||
|
||||
// Decrease until we reach minSamples
|
||||
// Decrease down to minSamples
|
||||
if(noOfSamples > minNumberOfSamples) {
|
||||
noOfSamples = Math.min( (noOfSamples - 1), Math.max( (noOfSamples - processed), minNumberOfSamples));
|
||||
noOfSamples = Math.min( (noOfSamples - 1), Math.max( (noOfSamples - processed) + 5, minNumberOfSamples));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue