Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mod: update the comments in metrics #547

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions metrics/prometheus/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ func init() {
extension.SetMetricReporter(reporterName, newPrometheusReporter)
}

// PrometheusReporter
// it will collect the data for Prometheus
// if you want to use this, you should initialize your prometheus.
// PrometheusReporter will collect the data for Prometheus
// if you want to use this feature, you need to initialize your prometheus.
// https://prometheus.io/docs/guides/go-application/
type PrometheusReporter struct {

Expand All @@ -85,7 +84,7 @@ type PrometheusReporter struct {
consumerHistogramVec *prometheus.HistogramVec
}

// Report report the duration to Prometheus
// Report reports the duration to Prometheus
// the role in url must be consumer or provider
// or it will be ignored
func (reporter *PrometheusReporter) Report(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation, cost time.Duration, res protocol.Result) {
Expand All @@ -99,7 +98,7 @@ func (reporter *PrometheusReporter) Report(ctx context.Context, invoker protocol
sumVec = reporter.consumerSummaryVec
hisVec = reporter.consumerHistogramVec
} else {
logger.Warnf("The url is not the consumer's or provider's, "+
logger.Warnf("The url belongs neither the consumer nor the provider, "+
"so the invocation will be ignored. url: %s", url.String())
return
}
Expand Down
2 changes: 1 addition & 1 deletion metrics/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const (
NameSpace = "dubbo"
)

// it will be use to report the invocation's duration
// Reporter will be used to report the invocation's duration
type Reporter interface {
// report the duration of an invocation
Report(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation,
Expand Down