Skip to content

Commit

Permalink
W-14071255: mark null-value datapoints as absent
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoineausf committed Sep 8, 2023
1 parent fc4ba71 commit 4032a7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,15 @@ else if ( protobuf )
{
LOG.info( String.format( "carbonapi request: found value [%s]",
( value == null ? "null" : (double) value ) ) );
metricsSeriesBuilder = metricsSeriesBuilder
.addValues( value == null ? "null" : String.format( "%d", value ) ).addIsAbsent( false );
if ( value == null )
{

metricsSeriesBuilder = metricsSeriesBuilder.addIsAbsent( true );
}
else
{
metricsSeriesBuilder = metricsSeriesBuilder.addValues( value ).addIsAbsent( false );
}
}

MetricsResponse.Series metricsSeries = metricsSeriesBuilder.build();
Expand Down
2 changes: 1 addition & 1 deletion carbonj.service/src/main/protobuf/MetricsResponse.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ message Series {
required int32 start = 2;
required int32 end = 3;
required int32 step = 4;
repeated boolean values = 5;
repeated double values = 5;
repeated bool isAbsent = 6;
}

Expand Down

0 comments on commit 4032a7b

Please sign in to comment.