Fix issues with outputting values
Ensure numbers are formatted as floats.
This commit is contained in:
parent
7868c83840
commit
2549c482fb
1 changed files with 11 additions and 5 deletions
|
|
@ -22,6 +22,7 @@
|
|||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-9)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 format)
|
||||
#:use-module (ice-9 threads)
|
||||
#:use-module (ice-9 exceptions)
|
||||
#:export (make-metrics-registry
|
||||
|
|
@ -404,9 +405,9 @@ so that it can receive and store the metric values."
|
|||
|
||||
(hash-for-each
|
||||
(lambda (label-values value)
|
||||
(simple-format
|
||||
(format
|
||||
port
|
||||
"~A~A ~A\n"
|
||||
"~a~a ~f\n"
|
||||
full-name
|
||||
(if (null? label-values)
|
||||
""
|
||||
|
|
@ -414,10 +415,15 @@ so that it can receive and store the metric values."
|
|||
"{"
|
||||
(string-join (map
|
||||
(match-lambda
|
||||
((label . value)
|
||||
(simple-format
|
||||
((label . (? number? value))
|
||||
(format
|
||||
#f
|
||||
"~A=\"~A\""
|
||||
"~a=\"~f\""
|
||||
label value))
|
||||
((label . value)
|
||||
(format
|
||||
#f
|
||||
"~a=\"~a\""
|
||||
label value)))
|
||||
label-values)
|
||||
",")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue