Skip to content

Commit

Permalink
ui: avoid calling sink format in extra data
Browse files Browse the repository at this point in the history
  • Loading branch information
cuonglm committed Nov 5, 2019
1 parent b00b092 commit 32131dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,16 @@ func summarizeMetricsJSON(w io.Writer, t time.Duration, timeUnit string, metrics
for name, m := range metrics {
m.Sink.Calc()

data[name] = m.Sink.Format(t)
sinkData := m.Sink.Format(t)
data[name] = sinkData
if _, ok := m.Sink.(*stats.TrendSink); ok {
continue
}

_, extra := nonTrendMetricValueForSum(t, timeUnit, m)
if len(extra) > 1 {
extraData := make(map[string]interface{})
extraData["value"] = m.Sink.Format(t)["value"]
extraData["value"] = sinkData["value"]
extraData["extra"] = extra
data[name] = extraData
}
Expand Down

0 comments on commit 32131dc

Please sign in to comment.