From 9ae3bdce735a6fd315b18bc475a420642a8287d4 Mon Sep 17 00:00:00 2001 From: Paul Moineau Date: Wed, 6 Sep 2023 15:52:58 -0400 Subject: [PATCH] test value of type string --- .../carbonj/service/engine/GraphiteSeriesDataServlet.java | 3 ++- carbonj.service/src/main/protobuf/MetricsResponse.proto | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/GraphiteSeriesDataServlet.java b/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/GraphiteSeriesDataServlet.java index e6bb03ee..d56ab57d 100644 --- a/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/GraphiteSeriesDataServlet.java +++ b/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/GraphiteSeriesDataServlet.java @@ -170,7 +170,8 @@ else if ( protobuf ) { LOG.info( String.format( "carbonapi request: found value [%s]", ( value == null ? "null" : (double) value ) ) ); - metricsSeriesBuilder = metricsSeriesBuilder.addValues( value ).addIsAbsent( false ); + metricsSeriesBuilder = metricsSeriesBuilder + .addValues( value == null ? "null" : String.format( "%d", value ) ).addIsAbsent( false ); } MetricsResponse.Series metricsSeries = metricsSeriesBuilder.build(); diff --git a/carbonj.service/src/main/protobuf/MetricsResponse.proto b/carbonj.service/src/main/protobuf/MetricsResponse.proto index 7a5099e5..985185d5 100644 --- a/carbonj.service/src/main/protobuf/MetricsResponse.proto +++ b/carbonj.service/src/main/protobuf/MetricsResponse.proto @@ -15,7 +15,7 @@ message Series { required int32 start = 2; required int32 end = 3; required int32 step = 4; - repeated double values = 5; + repeated string values = 5; repeated bool isAbsent = 6; }