@@ -28,6 +28,7 @@ type ProcessesMetricGroup struct {
2828func NewProcessesMetricGroup (reporter * MetricReporter ) * ProcessesMetricGroup {
2929 parentScope := reporter .GetScopeOrExit ("cluster" )
3030 p := & ProcessesMetricGroup {* newMetricGroup ("processes" , parentScope , reporter )}
31+ p .AddScope (parentScope , "grv_count" , "grv" )
3132 p .AddScope (parentScope , "grv_lat" , "grv" )
3233 p .AddScope (parentScope , "commit_lat" , "commit" )
3334 p .AddScope (parentScope , "read_lat" , "read" )
@@ -102,6 +103,12 @@ func (p *ProcessesMetricGroup) getLatencyTags(processName string, process *model
102103 return tags
103104}
104105
106+ func (p * ProcessesMetricGroup ) getTagsWithPriority (processName string , process * models.Process , priority string ) map [string ]string {
107+ tags := p .getTags (processName , process )
108+ tags ["priority" ] = priority
109+ return tags
110+ }
111+
105112func (p * ProcessesMetricGroup ) getLatencyTagsWithPriority (processName string , process * models.Process , quantile string , priority string ) map [string ]string {
106113 tags := p .getLatencyTags (processName , process , quantile )
107114 tags ["priority" ] = priority
@@ -171,7 +178,12 @@ func (p *ProcessesMetricGroup) GetMetrics(status *models.FullStatus) {
171178 switch role .Role {
172179 case "grv_proxy" :
173180 if role .GrvLatencyStatistics != nil {
181+ grvCountScope := p .GetScopeOrExit ("grv_count" )
174182 grvLatScope := p .GetScopeOrExit ("grv_lat" )
183+ defaultCountTags := p .getTagsWithPriority (processName , & process , "default" )
184+ batchCountTags := p .getTagsWithPriority (processName , & process , "batch" )
185+ SetGauge (grvCountScope , "count" , defaultCountTags , role .GrvLatencyStatistics .Default .Count )
186+ SetGauge (grvCountScope , "count" , batchCountTags , role .GrvLatencyStatistics .Batch .Count )
175187 defaultMedianTags := p .getLatencyTagsWithPriority (processName , & process , "0.5" , "default" )
176188 batchMedianTags := p .getLatencyTagsWithPriority (processName , & process , "0.5" , "batch" )
177189 SetGauge (grvLatScope , "latency" , defaultMedianTags , role .GrvLatencyStatistics .Default .Median )
0 commit comments