Skip to content

Commit

Permalink
W-13680300: formatted test response
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoineausf committed Jul 14, 2023
1 parent d29a6ea commit e3b49b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import com.demandware.carbonj.service.db.model.Series;
import com.demandware.carbonj.service.engine.protobuf.MetricsResponse;
import com.demandware.carbonj.service.engine.protobuf.TestResponse;
import com.demandware.carbonj.service.events.EventsLogger;
import com.demandware.carbonj.service.db.TimeSeriesStore;
import com.demandware.carbonj.service.db.model.Metric;
Expand Down Expand Up @@ -142,12 +143,17 @@ else if (protobuf) {

MetricsResponse.MetricList response =
MetricsResponse.MetricList.newBuilder().addAllMetricList(metricList).build();

TestResponse.TestValue testResponse = TestResponse.TestValue.newBuilder().setValue((double)1).setName("testValue").build();

LOG.info( "carbonapi request: done formatting response " + response);
//LOG.info( "carbonapi request: done formatting response " + response);
LOG.info( "carbonapi request: done formatting test response " + testResponse);
try
{
LOG.info( "carbonapi request: writing response" );
response.writeTo( output );
LOG.info( "carbonapi request: writing test response" );
testResponse.writeTo(output);
//response.writeTo( output );

}
catch ( Exception e )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.demandware.carbonj.service.engine.protobuf.TestResponse;
import com.demandware.carbonj.service.events.EventsLogger;
import com.demandware.carbonj.service.db.TimeSeriesStore;
import com.demandware.carbonj.service.db.model.Series;
Expand Down Expand Up @@ -179,12 +180,16 @@ else if ( protobuf )
MetricsResponse.SeriesList response =
MetricsResponse.SeriesList.newBuilder().addAllSeriesList( metricsSeriesList ).build();

LOG.info( "carbonapi request: done formatting response " + response);
TestResponse.TestValue testResponse = TestResponse.TestValue.newBuilder().setValue((double)1).setName("testValue").build();

//LOG.info( "carbonapi request: done formatting response " + response);
LOG.info( "carbonapi request: done formatting response " + testResponse);

try
{
LOG.info( "carbonapi request: writing response" );
response.writeTo( output );
LOG.info( "carbonapi request: writing test response" );
testResponse.writeTo(output);
//response.writeTo( output );
}
catch ( Exception e )
{
Expand Down

0 comments on commit e3b49b3

Please sign in to comment.