srkukarni closed pull request #2866: Removed metrics from getstatus URL: https://github.com/apache/pulsar/pull/2866
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java b/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java index 3824619323..f76df6b1d7 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java @@ -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); diff --git a/pulsar-functions/proto/src/main/proto/InstanceCommunication.proto b/pulsar-functions/proto/src/main/proto/InstanceCommunication.proto index d56a41deef..6625539d90 100644 --- a/pulsar-functions/proto/src/main/proto/InstanceCommunication.proto +++ b/pulsar-functions/proto/src/main/proto/InstanceCommunication.proto @@ -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; } diff --git a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/ThreadRuntime.java b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/ThreadRuntime.java index 05cb87ff80..9dafbe93bb 100644 --- a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/ThreadRuntime.java +++ b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/ThreadRuntime.java @@ -113,13 +113,7 @@ public void stop() { } 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; } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services