Skip to content

Commit

Permalink
fix toString on operational metrics (#219) (#221)
Browse files Browse the repository at this point in the history
(cherry picked from commit d5f0cee)

Signed-off-by: Chenyang Ji <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 5658ed3 commit 74c51d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public String getDescription() {

@Override
public String toString() {
return String.format(Locale.ROOT, "%s (%s)", name(), description);
return String.format(Locale.ROOT, "%s", name());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ public void testEnumValues() {

public void testToString() {
// Test the toString method
assertEquals(
"LOCAL_INDEX_READER_PARSING_EXCEPTIONS (Number of errors when parsing with LocalIndexReader)",
OperationalMetric.LOCAL_INDEX_READER_PARSING_EXCEPTIONS.toString()
);
assertEquals("LOCAL_INDEX_READER_PARSING_EXCEPTIONS", OperationalMetric.LOCAL_INDEX_READER_PARSING_EXCEPTIONS.toString());
assertEquals("LOCAL_INDEX_EXPORTER_BULK_FAILURES", OperationalMetric.LOCAL_INDEX_EXPORTER_BULK_FAILURES.toString());
assertEquals("LOCAL_INDEX_EXPORTER_DELETE_FAILURES", OperationalMetric.LOCAL_INDEX_EXPORTER_DELETE_FAILURES.toString());
assertEquals("LOCAL_INDEX_EXPORTER_EXCEPTIONS", OperationalMetric.LOCAL_INDEX_EXPORTER_EXCEPTIONS.toString());
assertEquals("INVALID_EXPORTER_TYPE_FAILURES", OperationalMetric.INVALID_EXPORTER_TYPE_FAILURES.toString());
assertEquals("DATA_INGEST_EXCEPTIONS", OperationalMetric.DATA_INGEST_EXCEPTIONS.toString());
assertEquals("QUERY_CATEGORIZE_EXCEPTIONS", OperationalMetric.QUERY_CATEGORIZE_EXCEPTIONS.toString());
assertEquals("EXPORTER_FAIL_TO_CLOSE_EXCEPTION", OperationalMetric.EXPORTER_FAIL_TO_CLOSE_EXCEPTION.toString());
assertEquals("TOP_N_QUERIES_USAGE_COUNT", OperationalMetric.TOP_N_QUERIES_USAGE_COUNT.toString());
}
}

0 comments on commit 74c51d2

Please sign in to comment.