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/9eb248ef Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9eb248ef Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9eb248ef Branch: refs/heads/TINKERPOP-1642 Commit: 9eb248ef0f0f29e8cf11cd5391ef8d993e37f7af Parents: b689deb Author: Stephen Mallette <sp...@genoprime.com> Authored: Thu Mar 9 13:15:04 2017 -0500 Committer: Stephen Mallette <sp...@genoprime.com> Committed: Fri Mar 10 11:13:03 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/9eb248ef/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/9eb248ef/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/9eb248ef/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) {