From 2219f44a80a47223cc7cf9088b1efde03b9fd005 Mon Sep 17 00:00:00 2001 From: Helen <56097766+heyams@users.noreply.github.com> Date: Fri, 22 Jul 2022 12:27:11 -0700 Subject: [PATCH] Change weight to be int (#2415) --- .../implementation/quickpulse/QuickPulseDataCollector.java | 4 ++-- .../implementation/quickpulse/QuickPulseDataFetcher.java | 2 +- .../implementation/quickpulse/model/QuickPulseMetrics.java | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/QuickPulseDataCollector.java b/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/QuickPulseDataCollector.java index bedd4a59169..a014272543a 100644 --- a/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/QuickPulseDataCollector.java +++ b/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/QuickPulseDataCollector.java @@ -352,7 +352,7 @@ private static int charToInt(char c) { class FinalCounters { final int exceptions; - final long requests; + final int requests; final double requestsDuration; final int unsuccessfulRequests; final long rdds; @@ -370,7 +370,7 @@ private FinalCounters(Counters currentCounters) { CountAndDuration countAndDuration = Counters.decodeCountAndDuration(currentCounters.requestsAndDurations.get()); - requests = countAndDuration.count; + requests = (int) countAndDuration.count; this.requestsDuration = countAndDuration.duration; this.unsuccessfulRequests = currentCounters.unsuccessfulRequests.get(); diff --git a/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/QuickPulseDataFetcher.java b/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/QuickPulseDataFetcher.java index d5fe7eb16a2..e04d3adcc7b 100644 --- a/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/QuickPulseDataFetcher.java +++ b/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/QuickPulseDataFetcher.java @@ -183,7 +183,7 @@ private static List addMetricsToQuickPulseEnvelope( new QuickPulseMetrics( "\\ApplicationInsights\\Dependency Call Duration", counters.rddsDuration / counters.rdds, - counters.rdds)); + (int) counters.rdds)); } metricsList.add( new QuickPulseMetrics( diff --git a/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/model/QuickPulseMetrics.java b/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/model/QuickPulseMetrics.java index 7ae3cf42589..f9135b7b137 100644 --- a/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/model/QuickPulseMetrics.java +++ b/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/quickpulse/model/QuickPulseMetrics.java @@ -32,9 +32,9 @@ public class QuickPulseMetrics { private final double value; @JsonProperty(value = "Weight") - private final long weight; + private final int weight; - public QuickPulseMetrics(String name, double value, long weight) { + public QuickPulseMetrics(String name, double value, int weight) { this.name = name; this.value = value; this.weight = weight; @@ -48,7 +48,7 @@ public double getValue() { return value; } - public long getWeight() { + public int getWeight() { return weight; } }