From 876c1b0a18cd9ffbe8172e8ad3905e9f594371d7 Mon Sep 17 00:00:00 2001 From: Kirill Zakharenko Date: Mon, 19 Mar 2018 20:54:12 +0300 Subject: [PATCH] cmd/bosun: print db as well, when profiling influxdb queries --- cmd/bosun/expr/influx.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/bosun/expr/influx.go b/cmd/bosun/expr/influx.go index 05280345b4..b460fc50ad 100644 --- a/cmd/bosun/expr/influx.go +++ b/cmd/bosun/expr/influx.go @@ -196,7 +196,8 @@ func timeInfluxRequest(e *State, T miniprofiler.Timer, db, query, startDuration, if err != nil { return nil, err } - T.StepCustomTiming("influx", "query", q, func() { + q_key := fmt.Sprintf("%s: %s", db, q) + T.StepCustomTiming("influx", "query", q_key, func() { getFn := func() (interface{}, error) { res, err := conn.Query(client.Query{ Command: q, @@ -221,7 +222,7 @@ func timeInfluxRequest(e *State, T miniprofiler.Timer, db, query, startDuration, } var val interface{} var ok bool - val, err = e.Cache.Get(fmt.Sprintf("%s : %s", db, q), getFn) + val, err = e.Cache.Get(q_key, getFn) if s, ok = val.([]influxModels.Row); !ok { err = fmt.Errorf("influx: did not get a valid result from InfluxDB") }