Skip to content

Commit

Permalink
Replace deprecated DoubleFormat.decimalOrWhole() usages (#1726)
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye authored and shakuzen committed Dec 2, 2019
1 parent 0fa9097 commit e302e95
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Expand Up @@ -41,7 +41,7 @@ public String getMetricId() {

String asJson() {
String body = "{\"timeseriesId\":\"" + metricId + "\"" +
",\"dataPoints\":[[" + time + "," + DoubleFormat.decimalOrWhole(value) + "]]";
",\"dataPoints\":[[" + time + "," + DoubleFormat.wholeOrDecimal(value) + "]]";

if (dimensions != null && !dimensions.isEmpty()) {
body += ",\"dimensions\":{" +
Expand Down
Expand Up @@ -291,7 +291,7 @@ String writeEvent(Meter meter, Attribute... attributes) {
.append(escapeJson(name)).append('"');

for (Attribute attribute : attributes) {
sb.append(",\"").append(attribute.name).append("\":").append(DoubleFormat.decimalOrWhole(attribute.value));
sb.append(",\"").append(attribute.name).append("\":").append(DoubleFormat.wholeOrDecimal(attribute.value));
}

List<Tag> tags = getConventionTags(meter.getId());
Expand Down
Expand Up @@ -222,7 +222,7 @@ KairosMetricBuilder field(String key, String value) {
}

KairosMetricBuilder datapoints(long wallTime, double value) {
sb.append(",\"datapoints\":[[").append(wallTime).append(',').append(DoubleFormat.decimalOrWhole(value)).append("]]");
sb.append(",\"datapoints\":[[").append(wallTime).append(',').append(DoubleFormat.wholeOrDecimal(value)).append("]]");
return this;
}

Expand Down
Expand Up @@ -315,7 +315,7 @@ Stream<TimeSeries> createTimeSeries(HistogramSupport histogramSupport, boolean t
Arrays.stream(snapshot.percentileValues())
.map(valueAtP -> createTimeSeries(histogramSupport,
timeDomain ? valueAtP.value(getBaseTimeUnit()) : valueAtP.value(),
"p" + DoubleFormat.decimalOrWhole(valueAtP.percentile() * 100)))
"p" + DoubleFormat.wholeOrDecimal(valueAtP.percentile() * 100)))
);
}

Expand Down

0 comments on commit e302e95

Please sign in to comment.