Skip to content

Commit

Permalink
update metrics matrixorigin#16953
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenbin1002 committed Jun 28, 2024
1 parent efc1250 commit 7af0aef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 41 deletions.
10 changes: 5 additions & 5 deletions pkg/util/metric/v2/dashboard/grafana_dashboard_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,35 +90,35 @@ func (c *DashboardCreator) initTaskMergeTransferPageRow() dashboard.Option {
),
c.getPercentHist(
"Transfer duration since born",
c.getMetricWithFilter(`mo_task_transfer_duration_since_born_bucket`, ``),
c.getMetricWithFilter(`mo_task_short_duration_seconds_bucket`, `type="transfer_page_since_born_duration"`),
[]float64{0.50, 0.8, 0.90, 0.99},
SpanNulls(true),
timeseries.Span(3),
),
c.getPercentHist(
"Transfer memory latency",
c.getMetricWithFilter(`mo_task_transfer_latency_bucket`, `type="memory"`),
c.getMetricWithFilter(`mo_task_short_duration_seconds_bucket`, `type="transfer_mem_latency"`),
[]float64{0.50, 0.8, 0.90, 0.99},
SpanNulls(true),
timeseries.Span(3),
),
c.getPercentHist(
"Transfer disk latency",
c.getMetricWithFilter(`mo_task_transfer_latency_bucket`, `type="disk"`),
c.getMetricWithFilter(`mo_task_short_duration_seconds_bucket`, `type="transfer_disk_latency"`),
[]float64{0.50, 0.8, 0.90, 0.99},
SpanNulls(true),
timeseries.Span(3),
),
c.getPercentHist(
"Transfer page write latency in flush",
c.getMetricWithFilter(`mo_task_transfer_page_write_latency_bucket`, `type="flush"`),
c.getMetricWithFilter(`mo_task_short_duration_seconds_bucket`, `type="transfer_page_flush_latency"`),
[]float64{0.50, 0.8, 0.90, 0.99},
SpanNulls(true),
timeseries.Span(3),
),
c.getPercentHist(
"Transfer page write latency in merge",
c.getMetricWithFilter(`mo_task_transfer_page_write_latency_bucket`, `type="merge"`),
c.getMetricWithFilter(`mo_task_short_duration_seconds_bucket`, `type="transfer_page_merge_latency"`),
[]float64{0.50, 0.8, 0.90, 0.99},
SpanNulls(true),
timeseries.Span(3),
Expand Down
3 changes: 0 additions & 3 deletions pkg/util/metric/v2/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,8 @@ func initTaskMetrics() {
registry.MustRegister(taskSelectivityCounter)

registry.MustRegister(transferPageHitHistogram)
registry.MustRegister(transferLatencyHistogram)
registry.MustRegister(transferPageWriteLatencyHistogram)
registry.MustRegister(TransferPageRowHistogram)
registry.MustRegister(TransferPagesInChannelHistogram)
registry.MustRegister(TransferPageSinceBornDurationHistogram)
registry.MustRegister(TaskMergeTransferPageSizeGauge)

registry.MustRegister(TaskStorageUsageCacheMemUsedGauge)
Expand Down
40 changes: 7 additions & 33 deletions pkg/util/metric/v2/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ var (
TaskShowAccountsGetUsageDurationHistogram = taskShortDurationHistogram.WithLabelValues("show_accounts_get_storage_usage")
TaskShowAccountsTotalDurationHistogram = taskShortDurationHistogram.WithLabelValues("show_accounts_total_duration")

TransferPageFlushLatencyHistogram = taskShortDurationHistogram.WithLabelValues("transfer_page_flush_latency")
TransferPageMergeLatencyHistogram = taskShortDurationHistogram.WithLabelValues("transfer_page_merge_latency")

TransferMemLatencyHistogram = taskShortDurationHistogram.WithLabelValues("transfer_mem_latency")
TransferDiskLatencyHistogram = taskShortDurationHistogram.WithLabelValues("transfer_disk_latency")
TransferPageSinceBornDurationHistogram = taskShortDurationHistogram.WithLabelValues("transfer_page_since_born_duration")

taskLongDurationHistogram = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "mo",
Expand Down Expand Up @@ -153,18 +160,6 @@ var (
})
)

var (
transferLatencyHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "mo",
Subsystem: "task",
Name: "transfer_latency",
Help: "The total latency of transfer in seconds.",
}, []string{"type"})

TransferMemLatencyHistogram = transferLatencyHistogram.WithLabelValues("memory")
TransferDiskLatencyHistogram = transferLatencyHistogram.WithLabelValues("disk")
)

var (
TransferPagesInChannelHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{
Namespace: "mo",
Expand All @@ -173,24 +168,3 @@ var (
Help: "The number of page in channel.",
})
)

var (
transferPageWriteLatencyHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "mo",
Subsystem: "task",
Name: "transfer_page_write_latency",
Help: "The total latency of transfer write in seconds.",
}, []string{"type"})

TransferPageFlushLatencyHistogram = transferPageWriteLatencyHistogram.WithLabelValues("flush")
TransferPageMergeLatencyHistogram = transferPageWriteLatencyHistogram.WithLabelValues("merge")
)

var (
TransferPageSinceBornDurationHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{
Namespace: "mo",
Subsystem: "task",
Name: "transfer_duration_since_born",
Help: "The duration of transfer.",
})
)

0 comments on commit 7af0aef

Please sign in to comment.