Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ public class ProcessParser {
};

public static void parseSummary(String text, OperationMetrics metrics) {
Map<String, Integer> map = parse(text == null ? "{}" : text);
Map<String, Long> map = parse(text == null ? "{}" : text);

for (ServerMetrics m : ServerMetrics.values()) {
metrics.updateMetric(m, -1);
}

for (int i = 0; i < SUMMARY_FIELDS.length; i++) {
String field = SUMMARY_FIELDS[i];
Integer value = map.get(field);
Long value = map.get(field);
if (value != null) {
metrics.updateMetric(SUMMARY_METRICS[i], value);
}
}
}


public static Map<String, Integer> parse(String json) {
public static Map<String, Long> parse(String json) {
if (json == null) {
throw new IllegalArgumentException("json is null");
}
Expand All @@ -50,7 +50,7 @@ public static Map<String, Integer> parse(String json) {
throw new IllegalArgumentException("JSON must start with '{' and end with '}'");
}

Map<String, Integer> result = new HashMap<>();
Map<String, Long> result = new HashMap<>();

String content = json.substring(1, json.length() - 1).trim();
if (content.isEmpty()) {
Expand Down Expand Up @@ -79,7 +79,7 @@ public static Map<String, Integer> parse(String json) {
}

try {
int value = Integer.parseInt(valueStr);
long value = Long.parseLong(valueStr);
result.put(key, value);
} catch (NumberFormatException e) {
// ignore error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ public class Gauge implements Metric {

private volatile long value;

public Gauge(long readRows) {
this.value = readRows;
public Gauge(long value) {
this.value = value;
}

public void set(long value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
public enum ClientMetrics {

/**
* Operation duration in nanoseconds.
* Operation duration in milliseconds.
*/
OP_DURATION("client.opDuration"),

/**
* Duration of the operation serialization step in nanoseconds.
* Duration of the operation serialization step in milliseconds.
*/
OP_SERIALIZATION("client.opSerialization");

Expand Down
Loading