Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated DoubleFormat.decimalOrWhole() usages #1726

Merged
merged 1 commit into from Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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