diff --git a/hugegraph-scylladb/src/main/java/com/baidu/hugegraph/backend/store/scylladb/ScyllaDBMetrics.java b/hugegraph-scylladb/src/main/java/com/baidu/hugegraph/backend/store/scylladb/ScyllaDBMetrics.java index e780feab57..abeaab3672 100644 --- a/hugegraph-scylladb/src/main/java/com/baidu/hugegraph/backend/store/scylladb/ScyllaDBMetrics.java +++ b/hugegraph-scylladb/src/main/java/com/baidu/hugegraph/backend/store/scylladb/ScyllaDBMetrics.java @@ -45,17 +45,17 @@ protected void appendExtraMetrics(Map metrics, "DroppedMutations"); appendCounterMetrics(metrics, probe, this.keyspace(), this.tables(), "PendingFlushes"); - appendCounterMetrics(metrics, probe, this.keyspace(), this.tables(), - "KeyCacheHitRate"); + //appendCounterMetrics(metrics, probe, this.keyspace(), this.tables(), + // "KeyCacheHitRate"); appendCounterMetrics(metrics, probe, this.keyspace(), this.tables(), "BloomFilterFalseRatio"); System.out.println(">>>> probe WriteLatency"); //Table timer Metrics - appendTimerMetrics(metrics, probe, this.keyspace(), "WriteLatency"); - appendTimerMetrics(metrics, probe, this.keyspace(), "ReadLatency"); - appendTimerMetrics(metrics, probe, null, "WriteLatency"); - appendTimerMetrics(metrics, probe, null, "ReadLatency"); + //appendTimerMetrics(metrics, probe, this.keyspace(), "WriteLatency"); + //appendTimerMetrics(metrics, probe, this.keyspace(), "ReadLatency"); + //appendTimerMetrics(metrics, probe, null, "WriteLatency"); + //appendTimerMetrics(metrics, probe, null, "ReadLatency"); System.out.println(">>>> probe Cache"); // Cache Metrics @@ -70,9 +70,9 @@ protected void appendExtraMetrics(Map metrics, // Compaction Metrics appendCompactionMetrics(metrics, probe, "CompletedTasks"); appendCompactionMetrics(metrics, probe, "PendingTasks"); - appendCompactionMetrics(metrics, probe, "BytesCompacted"); + //appendCompactionMetrics(metrics, probe, "BytesCompacted"); System.out.println(">>>> probe Nodes"); -metrics.remove("write_latency_*"); +metrics.remove(MEM_UNIT); } } diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/api/MetricsApiTest.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/api/MetricsApiTest.java index 697e0c9e0b..c7179fa576 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/api/MetricsApiTest.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/api/MetricsApiTest.java @@ -95,7 +95,6 @@ public void testMetricsBackend() { assertMapContains(host, "estimate_num_keys"); break; case "cassandra": - case "scylladb": assertMapContains(graph, "cluster_id"); assertMapContains(graph, "servers"); @@ -157,6 +156,68 @@ public void testMetricsBackend() { assertMapContains(host, "exception_count"); } break; + case "scylladb": + assertMapContains(graph, "cluster_id"); + assertMapContains(graph, "servers"); + + servers = (Map) graph.get("servers"); + Assert.assertGte(1, servers.size()); + for (Map.Entry e : servers.entrySet()) { + String key = (String) e.getKey(); + value = e.getValue(); + Assert.assertTrue(String.format( + "Expect map value for key %s but got %s", + key, value), + value instanceof Map); + host = (Map) value; + assertMapContains(host, "mem_max"); + assertMapContains(host, "mem_commited"); + assertMapContains(host, "mem_used"); + assertMapContains(host, "mem_used_readable"); + assertMapContains(host, "mem_unit"); + + assertMapContains(host, "disk_usage"); + assertMapContains(host, "disk_usage_readable"); + assertMapContains(host, "disk_usage_details"); + assertMapContains(host, "disk_unit"); + + assertMapContains(host, "uptime"); + assertMapContains(host, "uptime_readable"); + assertMapContains(host, "time_unit"); + + assertMapContains(host, "estimated_partition_count"); + assertMapContains(host, "dropped_mutations"); + assertMapContains(host, "pending_flushes"); + //assertMapContains(host, "key_cache_hit_rate"); + assertMapContains(host, "bloom_filter_false_ratio"); + + //assertMapContains(host, "write_latency_hugegraph"); + //assertMapContains(host, "read_latency_hugegraph"); + //assertMapContains(host, "write_latency_*"); + //assertMapContains(host, "read_latency_*"); + + assertMapContains(host, "key_cache_size"); + assertMapContains(host, "key_cache_entries"); + assertMapContains(host, "row_cache_size"); + assertMapContains(host, "row_cache_entries"); + assertMapContains(host, "counter_cache_size"); + assertMapContains(host, "counter_cache_entries"); + + assertMapContains(host, "compaction_completed_tasks"); + assertMapContains(host, "compaction_pending_tasks"); + //assertMapContains(host, "compaction_bytes_compacted"); + + assertMapContains(host, "live_nodes"); + assertMapContains(host, "joining_nodes"); + assertMapContains(host, "moving_nodes"); + assertMapContains(host, "leaving_nodes"); + assertMapContains(host, "unreachable_nodes"); + + assertMapContains(host, "keyspaces"); + assertMapContains(host, "num_tables"); + assertMapContains(host, "exception_count"); + } + break; case "hbase": assertMapContains(graph, "cluster_id"); assertMapContains(graph, "master_name");