diff --git a/metrics/grafana/ticdc.json b/metrics/grafana/ticdc.json index 0f731ef7391..79e605dd679 100644 --- a/metrics/grafana/ticdc.json +++ b/metrics/grafana/ticdc.json @@ -7800,7 +7800,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 4eced9a8810..1d624aa3c84 100644 --- a/pkg/sink/kafka/metrics_collector.go +++ b/pkg/sink/kafka/metrics_collector.go @@ -134,9 +134,9 @@ func (m *saramaMetricsCollector) collectProducerMetrics() { if histogram, ok := compressionRatioMetric.(metrics.Histogram); ok { compressionRatioGauge. WithLabelValues(namespace, changefeedID, "avg"). - Set(histogram.Snapshot().Mean() / 100) + Set(histogram.Snapshot().Mean()) compressionRatioGauge.WithLabelValues(namespace, changefeedID, p99). - Set(histogram.Snapshot().Percentile(0.99) / 100) + Set(histogram.Snapshot().Percentile(0.99)) } recordsPerRequestMetric := m.registry.Get(recordsPerRequestMetricName)