diff --git a/api.go b/api.go index 43b9bb9..5c417e4 100644 --- a/api.go +++ b/api.go @@ -283,9 +283,7 @@ func handleQuery(rw http.ResponseWriter, r *http.Request) { res := make([]ApiMetricData, 0, len(sels)) for _, sel := range sels { data := ApiMetricData{} - data.Unit = "" - unit := "" - data.Data, data.From, data.To, unit, err = memoryStore.Read(sel, query.Metric, req.From, req.To) + data.Data, data.From, data.To, data.Unit, err = memoryStore.Read(sel, query.Metric, req.From, req.To) // log.Printf("data: %#v, %#v, %#v, %#v", data.Data, data.From, data.To, err) if err != nil { msg := err.Error() @@ -303,9 +301,6 @@ func handleQuery(rw http.ResponseWriter, r *http.Request) { if req.WithPadding { data.PadDataWithNull(req.From, req.To, query.Metric) } - if req.WithUnit && len(unit) > 0 { - data.Unit = unit - } if !req.WithData { data.Data = nil } diff --git a/config.json b/config.json index 3ec03fa..70d0483 100644 --- a/config.json +++ b/config.json @@ -1,27 +1,23 @@ { "metrics": { + "cpi": { "frequency": 15, "aggregation": "avg" }, "flops_any": { "frequency": 15, "aggregation": "sum" }, "flops_dp": { "frequency": 15, "aggregation": "sum" }, - "flops_sp": { "frequency": 15, "aggregation": "sum" }, - "mem_bw": { "frequency": 15, "aggregation": "sum" }, - "load_one": { "frequency": 15, "aggregation": null }, - "load_five": { "frequency": 15, "aggregation": null } + "flops_sp": { "frequency": 15, "aggregation": "sum" } }, "checkpoints": { "interval": "12h", - "directory": "./var/checkpoints", + "directory": "./testdata/checkpoints", "restore": "48h" }, "archive": { "interval": "168h", - "directory": "./var/archive" + "directory": "./testdata/archive" }, "http-api": { - "address": "0.0.0.0:8081", + "address": "127.0.0.1:8081", "https-cert-file": null, "https-key-file": null }, - "retention-in-memory": "48h", - "nats": null, - "jwt-public-key": "kzfYrYy+TzpanWZHJ5qSdMj5uKUWgq74BWhQG6copP0=" + "retention-in-memory": "48h" }