@CliCommand(value = LIST_COUNTERS, help = "List all available counter names") public Table list() { PagedResources<MetricResource> list = counterOperations().list(); return displayMetrics(list); }
@CliCommand(value = DELETE_COUNTER, help = "Reset the counter with the given name") public String reset(@CliOption(mandatory = true, key = { "", "name" }, help = "the name of the counter to reset", optionContext = "existing-counter disable-string-converter") String name) { counterOperations().reset(name); return String.format("Deleted counter '%s'", name); }
@CliCommand(value = DISPLAY_COUNTER, help = "Display the value of a counter") public String display(@CliOption(key = { "", "name" }, help = "the name of the counter to display", mandatory = true, optionContext = "existing-counter disable-string-converter") String name, @CliOption(key = "pattern", help = "the pattern used to format the value (see DecimalFormat)", unspecifiedDefaultValue = NumberFormatConverter.DEFAULT) NumberFormat pattern) { CounterResource counter = counterOperations().retrieve(name); return pattern.format(counter.getValue()); }
@CliCommand(value = LIST_COUNTERS, help = "List all available counter names") public Table list() { PagedResources<MetricResource> list = counterOperations().list(); return displayMetrics(list); }
@CliCommand(value = DELETE_COUNTER, help = "Reset the counter with the given name") public String reset(@CliOption(mandatory = true, key = { "", "name" }, help = "the name of the counter to reset", optionContext = "existing-counter disable-string-converter") String name) { counterOperations().reset(name); return String.format("Deleted counter '%s'", name); }
@CliCommand(value = DISPLAY_COUNTER, help = "Display the value of a counter") public String display(@CliOption(key = { "", "name" }, help = "the name of the counter to display", mandatory = true, optionContext = "existing-counter disable-string-converter") String name, @CliOption(key = "pattern", help = "the pattern used to format the value (see DecimalFormat)", unspecifiedDefaultValue = NumberFormatConverter.DEFAULT) NumberFormat pattern) { CounterResource counter = counterOperations().retrieve(name); return pattern.format(counter.getValue()); }
break; case "counter": counterOperations().list().forEach(mr -> completions.add(new Completion(mr.getName()))); break; case "field-value-counter":
break; case "counter": counterOperations().list().forEach(mr -> completions.add(new Completion(mr.getName()))); break; case "field-value-counter":