Skip to content

Commit 11750be

Browse files
authored
metrics: update distsql_copr_resp_size unit (#59991)
ref #59990
1 parent 686fee8 commit 11750be

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

pkg/metrics/distsql.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ func InitDistSQLMetrics() {
8989
Subsystem: "distsql",
9090
Name: "copr_resp_size",
9191
Help: "copr task response data size in bytes.",
92-
Buckets: prometheus.ExponentialBuckets(1024, 2, 20),
92+
Buckets: prometheus.ExponentialBuckets(1, 2, 10),
9393
}, []string{LblStore})
9494
}

pkg/metrics/grafana/tidb.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -23717,7 +23717,9 @@
2371723717
"datasource": "${DS_TEST-CLUSTER}",
2371823718
"description": "The total coprocessor response size between each tidb and tikv",
2371923719
"fieldConfig": {
23720-
"defaults": {},
23720+
"defaults": {
23721+
"unit": "KiBs"
23722+
},
2372123723
"overrides": []
2372223724
},
2372323725
"fill": 0,
@@ -23787,7 +23789,7 @@
2378723789
"yaxes": [
2378823790
{
2378923791
"$$hashKey": "object:394",
23790-
"format": "binBps",
23792+
"format": "KiBs",
2379123793
"label": "",
2379223794
"logBase": 1,
2379323795
"max": null,
@@ -23817,7 +23819,9 @@
2381723819
"datasource": "${DS_TEST-CLUSTER}",
2381823820
"description": "Histogram of coprocessor response size in bytes between tidb and tikv",
2381923821
"fieldConfig": {
23820-
"defaults": {},
23822+
"defaults": {
23823+
"unit": "kbytes"
23824+
},
2382123825
"overrides": []
2382223826
},
2382323827
"fill": 0,
@@ -23914,7 +23918,7 @@
2391423918
"yaxes": [
2391523919
{
2391623920
"$$hashKey": "object:394",
23917-
"format": "bytes",
23921+
"format": "kbytes",
2391823922
"label": "",
2391923923
"logBase": 1,
2392023924
"max": null,

pkg/store/copr/coprocessor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ func (worker *copIteratorWorker) handleTaskOnce(bo *Backoffer, task *copTask) (*
14531453
}
14541454
metrics.TiKVCoprocessorHistogram.WithLabelValues(storeID, strconv.FormatBool(staleRead), scope).Observe(costTime.Seconds())
14551455
if copResp != nil {
1456-
tidbmetrics.DistSQLCoprRespBodySize.WithLabelValues(storeAddr).Observe(float64(len(copResp.Data)))
1456+
tidbmetrics.DistSQLCoprRespBodySize.WithLabelValues(storeAddr).Observe(float64(len(copResp.Data) / 1024))
14571457
}
14581458

14591459
var result *copTaskResult

0 commit comments

Comments
 (0)