Skip to content

Commit

Permalink
metrics(ticdc): refine exp boundary, record large row from 2k size (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
amyangfei authored Dec 9, 2022
1 parent d651082 commit 7aef2a0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cdc/sinkv2/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"github.com/prometheus/client_golang/prometheus"
)

// rowSizeLowBound is set to 128K, only track data event with size not smaller than it.
const largeRowSizeLowBound = 128 * 1024
// rowSizeLowBound is set to 2K, only track data event with size not smaller than it.
const largeRowSizeLowBound = 2 * 1024

// ---------- Metrics used in Statistics. ---------- //
var (
Expand All @@ -42,7 +42,7 @@ var (
Subsystem: "sinkv2",
Name: "large_row_size",
Help: "The size of all received row changed events (in bytes).",
Buckets: prometheus.ExponentialBuckets(largeRowSizeLowBound, 2, 10), // 128K~128M
Buckets: prometheus.ExponentialBuckets(largeRowSizeLowBound, 2, 15), // 2K~32M
}, []string{"namespace", "changefeed", "type"}) // type is for `sinkType`

// ExecDDLHistogram records the exexution time of a DDL.
Expand Down
2 changes: 1 addition & 1 deletion cdc/sinkv2/metrics/mq/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var (
Subsystem: "sinkv2",
Name: "mq_worker_send_message_duration",
Help: "Send Message duration(s) for MQ worker.",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), // 1ms~1000s
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), // 1ms~524s
}, []string{"namespace", "changefeed"})
// WorkerBatchSize record the size of each batched messages.
WorkerBatchSize = prometheus.NewHistogramVec(
Expand Down
8 changes: 4 additions & 4 deletions cdc/sinkv2/metrics/txn/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var (
Subsystem: "sinkv2",
Name: "txn_conflict_detect_duration",
Help: "Bucketed histogram of conflict detect time (s) for single DML statement.",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), // 1ms~1000s
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), // 1ms~524s
}, []string{"namespace", "changefeed"})

WorkerFlushDuration = prometheus.NewHistogramVec(
Expand All @@ -33,7 +33,7 @@ var (
Subsystem: "sinkv2",
Name: "txn_worker_flush_duration",
Help: "Flush duration (s) for txn worker.",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), // 1ms~1000s
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20), // 1ms~524s
}, []string{"namespace", "changefeed"})

WorkerBusyRatio = prometheus.NewCounterVec(
Expand All @@ -58,7 +58,7 @@ var (
Subsystem: "sinkv2",
Name: "txn_sink_dml_batch_commit",
Help: "Duration of committing a DML batch",
Buckets: prometheus.ExponentialBuckets(0.01, 2, 18), // 10ms~1000s
Buckets: prometheus.ExponentialBuckets(0.01, 2, 18), // 10ms~1310s
}, []string{"namespace", "changefeed"})

SinkDMLBatchCallback = prometheus.NewHistogramVec(
Expand All @@ -67,7 +67,7 @@ var (
Subsystem: "sinkv2",
Name: "txn_sink_dml_batch_callback",
Help: "Duration of execuing a batch of callbacks",
Buckets: prometheus.ExponentialBuckets(0.01, 2, 18), // 10ms~1000s
Buckets: prometheus.ExponentialBuckets(0.01, 2, 18), // 10ms~1300s
}, []string{"namespace", "changefeed"})
)

Expand Down
2 changes: 1 addition & 1 deletion metrics/grafana/ticdc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7038,7 +7038,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_TEST-CLUSTER}",
"description": "Size of large rows (size >= 128K).",
"description": "Size of large rows (size >= 2K).",
"fieldConfig": {
"defaults": {},
"overrides": []
Expand Down

0 comments on commit 7aef2a0

Please sign in to comment.