Skip to content

Commit

Permalink
Merge pull request #12 from xianlubird/master
Browse files Browse the repository at this point in the history
Add metrics suffix
  • Loading branch information
penglongli authored Sep 10, 2021
2 parents 704b908 + 36be620 commit a1791f9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ginmetrics/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ func (m *Monitor) SetDuration(duration []float64) {
m.reqDuration = duration
}

func (m *Monitor) SetMetricSuffix(suffix string) {
metricRequestTotal += suffix
metricRequestUVTotal += suffix
metricURIRequestTotal += suffix
metricRequestBody += suffix
metricResponseBody += suffix
metricRequestDuration += suffix
metricSlowRequest += suffix
}

// AddMetric add custom monitor metric.
func (m *Monitor) AddMetric(metric *Metric) error {
if _, ok := m.metrics[metric.Name]; ok {
Expand Down

0 comments on commit a1791f9

Please sign in to comment.