File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/main/java/cn/leancloud/kafka/consumer Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 11package cn .leancloud .kafka .consumer ;
22
33import org .apache .kafka .clients .consumer .Consumer ;
4+ import org .apache .kafka .common .Metric ;
5+ import org .apache .kafka .common .MetricName ;
46
57import java .io .Closeable ;
68import java .util .Collection ;
9+ import java .util .Map ;
710import java .util .concurrent .ExecutorService ;
811import java .util .concurrent .TimeUnit ;
912
@@ -80,6 +83,13 @@ public synchronized void subscribe(Collection<String> topics) {
8083 state = State .SUBSCRIBED ;
8184 }
8285
86+ /**
87+ * Get the metrics kept by the consumer
88+ */
89+ public Map <MetricName , ? extends Metric > metrics () {
90+ return consumer .metrics ();
91+ }
92+
8393 @ Override
8494 public void close () {
8595 if (closed ()) {
You can’t perform that action at this time.
0 commit comments