Skip to content

Commit 0d7045f

Browse files
committed
add grv counter metrics
1 parent 6928139 commit 0d7045f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

metrics/group_processes.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ func (p *ProcessesMetricGroup) getLatencyTags(processName string, process *model
102102
return tags
103103
}
104104

105+
func (p *ProcessesMetricGroup) getTagsWithPriority(processName string, process *models.Process, priority string) map[string]string {
106+
tags := p.getTags(processName, process)
107+
tags["priority"] = priority
108+
return tags
109+
}
110+
105111
func (p *ProcessesMetricGroup) getLatencyTagsWithPriority(processName string, process *models.Process, quantile string, priority string) map[string]string {
106112
tags := p.getLatencyTags(processName, process, quantile)
107113
tags["priority"] = priority
@@ -171,7 +177,12 @@ func (p *ProcessesMetricGroup) GetMetrics(status *models.FullStatus) {
171177
switch role.Role {
172178
case "grv_proxy":
173179
if role.GrvLatencyStatistics != nil {
180+
grvCountScope := p.GetScopeOrExit("grv")
174181
grvLatScope := p.GetScopeOrExit("grv_lat")
182+
defaultCountTags := p.getTagsWithPriority(processName, &process, "default")
183+
batchCountTags := p.getTagsWithPriority(processName, &process, "batch")
184+
SetGauge(grvCountScope, "count", defaultCountTags, role.GrvLatencyStatistics.Default.Count)
185+
SetGauge(grvCountScope, "count", batchCountTags, role.GrvLatencyStatistics.Batch.Count)
175186
defaultMedianTags := p.getLatencyTagsWithPriority(processName, &process, "0.5", "default")
176187
batchMedianTags := p.getLatencyTagsWithPriority(processName, &process, "0.5", "batch")
177188
SetGauge(grvLatScope, "latency", defaultMedianTags, role.GrvLatencyStatistics.Default.Median)

0 commit comments

Comments
 (0)