tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [2/2] tinkerpop git commit: TINKERPOP-1644 Renamed metrics for GremlinScriptEngine instances.
Date Thu, 09 Mar 2017 18:16:01 GMT
TINKERPOP-1644 Renamed metrics for GremlinScriptEngine instances.

Included the name of the GremlinScriptEngine and prefixed each metric with GremlinServer class
name to be consistent with other metrics.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ab3cc845
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ab3cc845
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ab3cc845

Branch: refs/heads/TINKERPOP-1644
Commit: ab3cc8450a6e59b8ffde34f21ad170e906363e27
Parents: 6325673
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Thu Mar 9 13:15:04 2017 -0500
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Thu Mar 9 13:15:04 2017 -0500

----------------------------------------------------------------------
 .../gremlin/server/op/session/Session.java      |  2 +-
 .../gremlin/server/util/MetricManager.java      | 31 ++++++++++----------
 .../server/util/ServerGremlinExecutor.java      |  2 +-
 3 files changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ab3cc845/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
index b8cb28c..6961339 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
@@ -269,6 +269,6 @@ public class Session {
         final GremlinScriptEngine engine = null == scriptEngines ?
                 gremlinExecutor.getScriptEngineManager().getEngineByName(engineName) :
                 scriptEngines.getEngineByName(engineName);
-        MetricManager.INSTANCE.registerGremlinScriptEngineMetrics(engine, "session", session,
"class-cache");
+        MetricManager.INSTANCE.registerGremlinScriptEngineMetrics(engine, engineName, "session",
session, "class-cache");
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ab3cc845/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/MetricManager.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/MetricManager.java
b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/MetricManager.java
index 06179d2..faec502 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/MetricManager.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/MetricManager.java
@@ -36,6 +36,7 @@ import info.ganglia.gmetric4j.gmetric.GMetric;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine;
 import org.apache.tinkerpop.gremlin.jsr223.GremlinScriptEngine;
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -429,49 +430,49 @@ public enum MetricManager {
         if (engine instanceof GremlinGroovyScriptEngine) {
             final GremlinGroovyScriptEngine gremlinGroovyScriptEngine = (GremlinGroovyScriptEngine)
engine;
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"long-run-compilation-count")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "long-run-compilation-count")),
                     (Gauge<Long>) gremlinGroovyScriptEngine::getClassCacheLongRunCompilationCount);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"estimated-size")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "estimated-size")),
                     (Gauge<Long>) gremlinGroovyScriptEngine::getClassCacheEstimatedSize);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"average-load-penalty")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "average-load-penalty")),
                     (Gauge<Double>) gremlinGroovyScriptEngine::getClassCacheAverageLoadPenalty);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"eviction-count")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "eviction-count")),
                     (Gauge<Long>) gremlinGroovyScriptEngine::getClassCacheEvictionCount);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"eviction-weight")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "eviction-weight")),
                     (Gauge<Long>) gremlinGroovyScriptEngine::getClassCacheEvictionWeight);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"hit-count")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "hit-count")),
                     (Gauge<Long>) gremlinGroovyScriptEngine::getClassCacheHitCount);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"hit-rate")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "hit-rate")),
                     (Gauge<Double>) gremlinGroovyScriptEngine::getClassCacheHitRate);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"load-count")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "load-count")),
                     (Gauge<Long>) gremlinGroovyScriptEngine::getClassCacheLoadCount);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"load-failure-count")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "load-failure-count")),
                     (Gauge<Long>) gremlinGroovyScriptEngine::getClassCacheLoadFailureCount);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"load-failure-rate")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "load-failure-rate")),
                     (Gauge<Double>) gremlinGroovyScriptEngine::getClassCacheLoadFailureRate);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"load-success-count")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "load-success-count")),
                     (Gauge<Long>) gremlinGroovyScriptEngine::getClassCacheLoadSuccessCount);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"miss-count")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "miss-count")),
                     (Gauge<Long>) gremlinGroovyScriptEngine::getClassCacheMissCount);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"miss-rate")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "miss-rate")),
                     (Gauge<Double>) gremlinGroovyScriptEngine::getClassCacheMissRate);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"request-count")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "request-count")),
                     (Gauge<Long>) gremlinGroovyScriptEngine::getClassCacheRequestCount);
             MetricManager.INSTANCE.getRegistry().register(
-                    MetricRegistry.name(GremlinGroovyScriptEngine.class, ArrayUtils.add(prefix,
"total-load-time")),
+                    MetricRegistry.name(GremlinServer.class, ArrayUtils.add(prefix, "total-load-time")),
                     (Gauge<Long>) gremlinGroovyScriptEngine::getClassCacheTotalLoadTime);
         }
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ab3cc845/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
index d66e0e8..e3c0cae 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
@@ -191,7 +191,7 @@ public class ServerGremlinExecutor<T extends ScheduledExecutorService>
{
         final GremlinScriptEngine engine = null == scriptEngines ?
                 gremlinExecutor.getScriptEngineManager().getEngineByName(engineName) :
                 scriptEngines.getEngineByName(engineName);
-        MetricManager.INSTANCE.registerGremlinScriptEngineMetrics(engine, "sessionless",
"class-cache");
+        MetricManager.INSTANCE.registerGremlinScriptEngineMetrics(engine, engineName, "sessionless",
"class-cache");
     }
 
     public void addHostOption(final String key, final Object value) {


Mime
View raw message