mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2024-12-27 09:19:06 +01:00
Remove WithUnit query option
This commit is contained in:
parent
eb5b22e3d5
commit
26335a2216
7
api.go
7
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
|
||||
}
|
||||
|
16
config.json
16
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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user