Skip to content

Commit 36be620

Browse files
author
xianluchen
committed
Add metrics suffix
1 parent 704b908 commit 36be620

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: ginmetrics/types.go

+10
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ func (m *Monitor) SetDuration(duration []float64) {
7878
m.reqDuration = duration
7979
}
8080

81+
func (m *Monitor) SetMetricSuffix(suffix string) {
82+
metricRequestTotal += suffix
83+
metricRequestUVTotal += suffix
84+
metricURIRequestTotal += suffix
85+
metricRequestBody += suffix
86+
metricResponseBody += suffix
87+
metricRequestDuration += suffix
88+
metricSlowRequest += suffix
89+
}
90+
8191
// AddMetric add custom monitor metric.
8292
func (m *Monitor) AddMetric(metric *Metric) error {
8393
if _, ok := m.metrics[metric.Name]; ok {

0 commit comments

Comments
 (0)