Skip to content

Commit

Permalink
Merge pull request #14 from metang326/master
Browse files Browse the repository at this point in the history
Add metrics prefix
  • Loading branch information
penglongli authored Oct 14, 2021
2 parents 9257eae + 1de3905 commit b65821f
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) SetMetricPrefix(prefix string) {
metricRequestTotal = prefix + metricRequestTotal
metricRequestUVTotal = prefix + metricRequestUVTotal
metricURIRequestTotal = prefix + metricURIRequestTotal
metricRequestBody = prefix + metricRequestBody
metricResponseBody = prefix + metricResponseBody
metricRequestDuration = prefix + metricRequestDuration
metricSlowRequest = prefix + metricSlowRequest
}

func (m *Monitor) SetMetricSuffix(suffix string) {
metricRequestTotal += suffix
metricRequestUVTotal += suffix
Expand Down

0 comments on commit b65821f

Please sign in to comment.