Skip to content

Commit

Permalink
Removed metrics from getstatus (apache#2866)
Browse files Browse the repository at this point in the history
  • Loading branch information
srkukarni authored Oct 28, 2018
1 parent dc397b0 commit 4c44a8c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,9 @@ public void testPulsarFunctionStats() throws Exception {
assertEquals(numInstances, 1);

FunctionStatus stats = functionStats.getFunctionStatusListList().get(0);
Map<String, DataDigest> metricsData = stats.getMetrics().getMetricsMap();

double count = metricsData.get(JavaInstanceRunnable.METRICS_TOTAL_PROCESSED).getCount();
double success = metricsData.get(JavaInstanceRunnable.METRICS_TOTAL_SUCCESS).getCount();
double count = stats.getNumProcessed();
double success = stats.getNumSuccessfullyProcessed();
String ownerWorkerId = stats.getWorkerId();
assertEquals((int) count, totalMsgs);
assertEquals((int) success, totalMsgs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ message FunctionStatus {
// expressed in ms since epoch
int64 lastInvocationTime = 13;
string instanceId = 14;
MetricsData metrics = 15;
MetricsData metrics = 15 [deprecated=true];
// owner of function-instance
string workerId = 16;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,7 @@ public CompletableFuture<FunctionStatus> getFunctionStatus(int instanceId) {
}
FunctionStatus.Builder functionStatusBuilder = javaInstanceRunnable.getFunctionStatus();
functionStatusBuilder.setRunning(true);
getMetrics().handle((metrics, e) -> {
if (e == null) {
functionStatusBuilder.setMetrics(metrics);
}
statsFuture.complete(functionStatusBuilder.build());
return null;
});
statsFuture.complete(functionStatusBuilder.build());
return statsFuture;
}

Expand Down

0 comments on commit 4c44a8c

Please sign in to comment.