Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
update log and client options
Browse files Browse the repository at this point in the history
  • Loading branch information
foreverneverer committed Jun 8, 2020
1 parent 1b73958 commit 8a23cab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
21 changes: 10 additions & 11 deletions src/main/java/com/xiaomi/infra/pegasus/client/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,8 @@ public Builder asyncWorkers(int asyncWorkers) {

/**
* Whether to enable performance statistics. If true, the client will periodically report
* metrics to local falcon agent (if set falcon as monitoring system) or open
* prometheus collector http server. Defaults to {@literal true}, see {@link
* #DEFAULT_ENABLE_PERF_COUNTER}.
* metrics to local falcon agent (if set falcon as monitoring system) or open prometheus
* collector http server. Defaults to {@literal true}, see {@link #DEFAULT_ENABLE_PERF_COUNTER}.
*
* @param enablePerfCounter enablePerfCounter
* @return {@code this}
Expand All @@ -215,8 +214,8 @@ public Builder enablePerfCounter(boolean enablePerfCounter) {
}

/**
* set the perf-counter type, now only support falcon and prometheus, Defaults to
* {@literal falcon}, see {@link #DEFAULT_PERF_COUNTER_TYPE}
* set the perf-counter type, now only support falcon and prometheus, Defaults to {@literal
* falcon}, see {@link #DEFAULT_PERF_COUNTER_TYPE}
*
* @param perfCounterType perfCounterType
* @return this
Expand All @@ -240,8 +239,8 @@ public Builder perfCounterTags(String perfCounterTags) {
}

/**
* The interval to report metrics to local falcon agent(if set falcon as
* monitor system). Defaults to {@literal 10s}, see {@link #DEFAULT_FALCON_PUSH_INTERVAL}.
* The interval to report metrics to local falcon agent(if set falcon as monitor system).
* Defaults to {@literal 10s}, see {@link #DEFAULT_FALCON_PUSH_INTERVAL}.
*
* @param falconPushInterval falconPushInterval
* @return {@code this}
Expand Down Expand Up @@ -338,8 +337,8 @@ public int getAsyncWorkers() {

/**
* Whether to enable performance statistics. If true, the client will periodically report metrics
* to local falcon agent (if set falcon as monitoring system) or open prometheus
* collector http server. Defaults to {@literal true}.
* to local falcon agent (if set falcon as monitoring system) or open prometheus collector http
* server. Defaults to {@literal true}.
*
* @return whether to enable performance statistics.
*/
Expand All @@ -366,8 +365,8 @@ public String getPerfCounterTags() {
}

/**
* The interval to report metrics to local falcon agent(if set falcon as monitor
* system). Defaults to {@literal 10s}.
* The interval to report metrics to local falcon agent(if set falcon as monitor system). Defaults
* to {@literal 10s}.
*
* @return the interval to report metrics to local falcon agent.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void genJsonsFromMeter(String name, Meter meter, StringBuilder output)
throws JSONException {
falconMetric.counterType = "GAUGE";

falconMetric.metric = name + ".cps-1sec";
falconMetric.metric = name + "_cps_1sec";
falconMetric.tags = getTableTag(name, defaultTags);
falconMetric.value = meter.getMeanRate();
oneMetricToJson(falconMetric, output);
Expand All @@ -64,13 +64,13 @@ public void genJsonsFromHistogram(String name, Histogram hist, StringBuilder out
falconMetric.counterType = "GAUGE";
Snapshot s = hist.getSnapshot();

falconMetric.metric = name + ".p99";
falconMetric.metric = name + "_p99";
falconMetric.tags = getTableTag(name, defaultTags);
falconMetric.value = s.get99thPercentile();
oneMetricToJson(falconMetric, output);
output.append(',');

falconMetric.metric = name + ".p999";
falconMetric.metric = name + "_p999";
falconMetric.tags = getTableTag(name, defaultTags);
falconMetric.value = s.get999thPercentile();
oneMetricToJson(falconMetric, output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ private void updateLatencyMetric(
Map<String, String> labels = getLabel(getTableTag(name, defaultTags));
Snapshot snapshot = meter.getValue().getSnapshot();
updateLatencyMetric(
formatLatencyMetricName(name, "99th"), snapshot.get99thPercentile(), labels, builder);
formatLatencyMetricName(name, "_p99"), snapshot.get99thPercentile(), labels, builder);
updateLatencyMetric(
formatLatencyMetricName(name, "999th"), snapshot.get999thPercentile(), labels, builder);
formatLatencyMetricName(name, "_p999"), snapshot.get999thPercentile(), labels, builder);
}

private void updateLatencyMetric(
Expand Down

0 comments on commit 8a23cab

Please sign in to comment.