Skip to content

Commit

Permalink
openmetrics formatter: emit gauge metrics (#504)
Browse files Browse the repository at this point in the history
`count` was not a valid metric type and `gauge` is the better type since
counters are expected to strictly increase.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
  • Loading branch information
jan--f authored Sep 6, 2024
1 parent 0d5fc56 commit e431ee7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions processor/formatters.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ var tabularWideUlocLanguageFormatBody = "(ULOC) %46d\n"
var tabularWideUlocGlobalFormatBody = "Unique Lines of Code (ULOC) %25d\n"
var tabularWideFormatBodyPercent = "Percentage %31.1f%% %8.1f%% %7.1f%% %8.1f%% %7.1f%% %9.1f%%\n"

var openMetricsMetadata = `# TYPE scc_files count
var openMetricsMetadata = `# TYPE scc_files gauge
# HELP scc_files Number of sourcecode files.
# TYPE scc_lines count
# TYPE scc_lines gauge
# HELP scc_lines Number of lines.
# TYPE scc_code count
# TYPE scc_code gauge
# HELP scc_code Number of lines of actual code.
# TYPE scc_comments count
# TYPE scc_comments gauge
# HELP scc_comments Number of comments.
# TYPE scc_blanks count
# TYPE scc_blanks gauge
# HELP scc_blanks Number of blank lines.
# TYPE scc_complexity count
# TYPE scc_complexity gauge
# HELP scc_complexity Code complexity.
# TYPE scc_bytes count
# TYPE scc_bytes gauge
# UNIT scc_bytes bytes
# HELP scc_bytes Size in bytes.
`
Expand Down

0 comments on commit e431ee7

Please sign in to comment.