mirror of
				https://github.com/ClusterCockpit/cc-metric-store.git
				synced 2025-10-28 07:45:07 +01:00 
			
		
		
		
	Remove WithUnit query option
This commit is contained in:
		
							
								
								
									
										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" | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user