Skip to content

Commit

Permalink
remove debug info
Browse files Browse the repository at this point in the history
Change-Id: Iec1304acaac89beaa893b1fb56aa671a6daa695e
  • Loading branch information
javeme committed May 29, 2021
1 parent fb9e54c commit 8549b68
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ protected Map<String, Object> getMetricsByHost(String host) {
*/
} catch (Throwable e) {
metrics.put(EXCEPTION, e.toString());
e.printStackTrace();
}
return metrics;
}
Expand All @@ -158,14 +157,12 @@ protected void appendExtraMetrics(Map<String, Object> metrics,
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");

System.out.println(">>>> probe Cache");
// Cache Metrics
appendCacheMetrics(metrics, probe, "KeyCache", "Size");
appendCacheMetrics(metrics, probe, "KeyCache", "Entries");
Expand All @@ -174,14 +171,10 @@ protected void appendExtraMetrics(Map<String, Object> metrics,
appendCacheMetrics(metrics, probe, "CounterCache", "Size");
appendCacheMetrics(metrics, probe, "CounterCache", "Entries");

System.out.println(">>>> probe Compaction");
// Compaction Metrics
appendCompactionMetrics(metrics, probe, "CompletedTasks");
appendCompactionMetrics(metrics, probe, "PendingTasks");
appendCompactionMetrics(metrics, probe, "BytesCompacted");

System.out.println(">>>> probe Nodes");
metrics.remove("write_latency_*");
}

protected static void appendCounterMetrics(Map<String, Object> metrics,
Expand All @@ -195,14 +188,6 @@ protected static void appendCounterMetrics(Map<String, Object> metrics,
// Aggregation of metrics for the whole host tables
Number number = 0;
for (String table : tables) {
// just for debug
try {
probe.getColumnFamilyMetric(keyspace, table, metric);
} catch (Throwable e) {
System.out.println(">>>> probe error1: " + name); e.printStackTrace();
metrics.put(name, e.toString());
return;
}
// like: "hugegraph", "g_v", "EstimatedPartitionCount"
Object value = probe.getColumnFamilyMetric(keyspace, table, metric);
if (!(value instanceof Number)) {
Expand All @@ -220,16 +205,6 @@ protected static void appendTimerMetrics(Map<String, Object> metrics,
// "ReadLatency" => "read_latency_hugegraph"
String suffix = keyspace == null ? "*" : keyspace;
String name = humpToLine(metric + "_" + suffix);
// just for debug
try {
JmxTimerMBean value = (JmxTimerMBean) probe.getColumnFamilyMetric(
keyspace, null, metric);
value.getCount();
} catch (Throwable e) {
System.out.println(">>>> probe error2: " + name); e.printStackTrace();
metrics.put(name, e.toString());
return;
}
// Aggregation of metrics for the whole host if keyspace=null
JmxTimerMBean value = (JmxTimerMBean) probe.getColumnFamilyMetric(
keyspace, null, metric);
Expand Down Expand Up @@ -260,17 +235,6 @@ protected static void appendCompactionMetrics(Map<String, Object> metrics,
String metric) {
// "CompletedTasks" => "compaction_completed_tasks"
String name = humpToLine("compaction" + metric);
// just for debug
try {
Object value = probe.getCompactionMetric(metric);
if (value instanceof JmxCounterMBean) {
value = ((JmxCounterMBean) value).getCount();
}
} catch (Throwable e) {
System.out.println(">>>> probe error3: " + name); e.printStackTrace();
metrics.put(name, e.toString());
return;
}
Object value = probe.getCompactionMetric(metric);
if (value instanceof JmxCounterMBean) {
value = ((JmxCounterMBean) value).getCount();
Expand All @@ -284,14 +248,6 @@ protected static void appendCacheMetrics(Map<String, Object> metrics,
String metric) {
// "RowCache" + "Size" => "row_cache_size"
String name = humpToLine(cacheType + metric);
// just for debug
try {
probe.getCacheMetric(cacheType, metric);
} catch (Throwable e) {
System.out.println(">>>> probe error4: " + name); e.printStackTrace();
metrics.put(name, e.toString());
return;
}
metrics.put(name, probe.getCacheMetric(cacheType, metric));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,12 @@ protected void appendExtraMetrics(Map<String, Object> metrics,
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");

System.out.println(">>>> probe Cache");
// Cache Metrics
appendCacheMetrics(metrics, probe, "KeyCache", "Size");
appendCacheMetrics(metrics, probe, "KeyCache", "Entries");
Expand All @@ -66,13 +64,9 @@ protected void appendExtraMetrics(Map<String, Object> metrics,
appendCacheMetrics(metrics, probe, "CounterCache", "Size");
appendCacheMetrics(metrics, probe, "CounterCache", "Entries");

System.out.println(">>>> probe Compaction");
// Compaction Metrics
appendCompactionMetrics(metrics, probe, "CompletedTasks");
appendCompactionMetrics(metrics, probe, "PendingTasks");
//appendCompactionMetrics(metrics, probe, "BytesCompacted");

System.out.println(">>>> probe Nodes");
metrics.remove(MEM_UNIT);
}
}

0 comments on commit 8549b68

Please sign in to comment.