This is an automated email from the ASF dual-hosted git repository.

sanjeevrk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c44a8c  Removed metrics from getstatus (#2866)
4c44a8c is described below

commit 4c44a8cba032812d475c186405e3bf55d0433bc3
Author: Sanjeev Kulkarni <sanjee...@gmail.com>
AuthorDate: Sun Oct 28 07:57:53 2018 -0700

    Removed metrics from getstatus (#2866)
---
 .../src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java | 5 ++---
 pulsar-functions/proto/src/main/proto/InstanceCommunication.proto | 2 +-
 .../java/org/apache/pulsar/functions/runtime/ThreadRuntime.java   | 8 +-------
 3 files changed, 4 insertions(+), 11 deletions(-)

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 3824619..f76df6b 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 class PulsarFunctionE2ETest {
         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 d56a41d..6625539 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 05cb87f..9dafbe9 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 @@ class ThreadRuntime implements Runtime {
         }
         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;
     }
 

Reply via email to