diff --git a/metrics/grafana/ticdc.json b/metrics/grafana/ticdc.json index bb2d551f888..ac895efe0aa 100644 --- a/metrics/grafana/ticdc.json +++ b/metrics/grafana/ticdc.json @@ -7572,7 +7572,7 @@ }, "yaxes": [ { - "format": "none", + "format": "percent", "label": null, "logBase": 1, "max": null, diff --git a/pkg/sink/codec/common/compress.go b/pkg/sink/codec/common/compress.go index fdf310223cb..dbcdce84451 100644 --- a/pkg/sink/codec/common/compress.go +++ b/pkg/sink/codec/common/compress.go @@ -28,7 +28,7 @@ func Compress(changefeedID model.ChangeFeedID, cc string, data []byte) ([]byte, } newSize := len(compressed) - ratio := float64(oldSize) / float64(newSize) + ratio := float64(oldSize) / float64(newSize) * 100 compressionRatio.WithLabelValues(changefeedID.Namespace, changefeedID.ID).Observe(ratio) diff --git a/pkg/sink/kafka/metrics_collector.go b/pkg/sink/kafka/metrics_collector.go index ff3c1c82b41..0c70047aa21 100644 --- a/pkg/sink/kafka/metrics_collector.go +++ b/pkg/sink/kafka/metrics_collector.go @@ -133,7 +133,7 @@ func (m *saramaMetricsCollector) collectProducerMetrics() { if histogram, ok := compressionRatioMetric.(metrics.Histogram); ok { compressionRatioGauge. WithLabelValues(namespace, changefeedID). - Set(histogram.Snapshot().Mean() / 100) + Set(histogram.Snapshot().Mean()) } recordsPerRequestMetric := m.registry.Get(recordsPerRequestMetricName)