You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/04/03 14:30:21 UTC

[GitHub] [ignite] Vladsz83 commented on a change in pull request #7622: IGNITE-12464 Service metrics

Vladsz83 commented on a change in pull request #7622: IGNITE-12464 Service metrics
URL: https://github.com/apache/ignite/pull/7622#discussion_r403046757
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/IgniteServiceProcessor.java
 ##########
 @@ -1801,4 +1818,95 @@ private boolean enterBusy() {
     private void leaveBusy() {
         opsLock.readLock().unlock();
     }
+
+    /**
+     * Caches metrics to measure durations of service methods.
+     *
+     * @param srvc Service to measure durations of methods.
+     * @param srvcName Name of {@code srvc}.
+     */
+    private void cacheServiceMetrics(Service srvc, String srvcName) {
+        Map<GridServiceMethodReflectKey, HistogramMetricImpl> srvcHistograms = invocationHistograms.get(srvcName);
+
+        // The histogms might be already created by multipile-deploy.
+        if (srvcHistograms != null)
+            return;
+
+        srvcHistograms = new HashMap<>();
+
+        for (Class<?> itf : allInterfaces(srvc.getClass())) {
+            for (Method mtd : itf.getMethods()) {
+                if (metricIgnored(mtd.getDeclaringClass()))
+                    continue;
+
+                HistogramMetricImpl histogram = createHistogram(srvcName, mtd);
+
+                srvcHistograms.put(new GridServiceMethodReflectKey(mtd.getName(), mtd.getParameterTypes()), histogram);
+            }
+        }
+
+        invocationHistograms.put(srvcName, srvcHistograms);
 
 Review comment:
   Fixed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services