Conversion to milliseconds
Change-Id: I268aa2dd0329a5c65a256a49adfebe173144dec5
This commit is contained in:
parent
b7acdad183
commit
6b6fc48f6d
@ -79,7 +79,7 @@ public class MetricHandler extends FlushableHandler<MetricEnvelope[]> {
|
||||
|
||||
this.ordinal = ordinal;
|
||||
|
||||
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT-0"));
|
||||
}
|
||||
|
||||
@ -164,10 +164,10 @@ public class MetricHandler extends FlushableHandler<MetricEnvelope[]> {
|
||||
.addDefinitionDimensionToBatch(definitionDimensionsSha1HashId, definitionSha1HashId,
|
||||
dimensionsSha1HashId);
|
||||
definitionDimensionsCounter.inc();
|
||||
String timeStamp = simpleDateFormat.format(new Date(metric.getTimestamp() * 1000));
|
||||
String timeStamp = simpleDateFormat.format(new Date(metric.getTimestamp()));
|
||||
double value = metric.getValue();
|
||||
metricRepo.addMetricToBatch(definitionDimensionsSha1HashId, timeStamp, value,
|
||||
metric.getValueMeta());
|
||||
metric.getValueMeta());
|
||||
metricCounter.inc();
|
||||
metricCount++;
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class InfluxV8MetricRepo extends InfluxMetricRepo
|
||||
private final InfluxV8RepoWriter influxV8RepoWriter;
|
||||
|
||||
private final SimpleDateFormat simpleDateFormat =
|
||||
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss zzz");
|
||||
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS zzz");
|
||||
|
||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@ -62,7 +62,7 @@ public class InfluxV8MetricRepo extends InfluxMetricRepo
|
||||
@Override
|
||||
protected void write() throws Exception {
|
||||
|
||||
this.influxV8RepoWriter.write(TimeUnit.SECONDS, getSeries());
|
||||
this.influxV8RepoWriter.write(TimeUnit.MILLISECONDS, getSeries());
|
||||
}
|
||||
|
||||
private Serie[] getSeries() throws Exception {
|
||||
@ -82,7 +82,7 @@ public class InfluxV8MetricRepo extends InfluxMetricRepo
|
||||
for (final Measurement measurement : entry.getValue()) {
|
||||
final Object[] colValsObjArry = new Object[COL_NAMES_STRING_ARRY.length];
|
||||
final Date date = this.simpleDateFormat.parse(measurement.time + " UTC");
|
||||
final Long time = date.getTime() / 1000;
|
||||
final Long time = date.getTime();
|
||||
colValsObjArry[0] = time;
|
||||
logger.debug("Added column value to colValsObjArry[{}] = {}", 0, colValsObjArry[0]);
|
||||
colValsObjArry[1] = measurement.value;
|
||||
|
@ -43,7 +43,7 @@ public class InfluxV9MetricRepo extends InfluxMetricRepo {
|
||||
private static final Logger logger = LoggerFactory.getLogger(InfluxV9MetricRepo.class);
|
||||
|
||||
private final SimpleDateFormat simpleDateFormat =
|
||||
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss zzz");
|
||||
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS zzz");
|
||||
|
||||
private final InfluxV9RepoWriter influxV9RepoWriter;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user