Skip to content

Commit 0c933c9

Browse files
committed
core/met: do not format temporal floats
1 parent 3687f66 commit 0c933c9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

intra/core/runmet.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ const (
4444
MetSchedPausesTotalOther = MetSched + "/pauses/total/other"
4545

4646
memoizationThreshold = 10 * time.Second
47+
48+
// format temporal units to nanos?
49+
fmtTemporal = false
4750
)
4851

4952
type metricUnit = int
@@ -137,7 +140,7 @@ func Metrics() string {
137140
s := fmt.Sprintf("%s: hist(%s)", name, histo2str(value.Float64Histogram(), u, '\n'))
138141
sb.WriteString(s)
139142
if strings.HasPrefix(name, MetGCHeap) {
140-
s := fmt.Sprintf("%s: percentiles(%s)", name, histo2Ps(value.Float64Histogram(), u, '\n'))
143+
s := fmt.Sprintf("\n%s: percentiles(%s)", name, histo2Ps(value.Float64Histogram(), u, '\n'))
141144
sb.WriteString(s)
142145
s = fmt.Sprintf("\n%s: dist(%s)", name, histo2Ms(value.Float64Histogram(), u, '\n'))
143146
sb.WriteString(s)
@@ -410,7 +413,10 @@ func histo2Ms(h *metrics.Float64Histogram, u metricUnit, sepb byte) string {
410413
func unit4float(v float64, u metricUnit) string {
411414
switch u {
412415
case unitTemporal:
413-
return FmtNanos(v)
416+
if fmtTemporal {
417+
return FmtNanos(v)
418+
}
419+
return fmt.Sprintf("%f", v)
414420
case unitPercent:
415421
return fmt.Sprintf("%.2f%%", v)
416422
case unitBytes:

0 commit comments

Comments
 (0)