Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: server/internal/logdog/archivist/archivist.go

Issue 2123853002: Added unit annotation supports onto tsmon in go. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: Specify the unit of logdog/collector/subscription/processing_time_ms with types.Milliseconds Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « server/cmd/logdog_collector/main.go ('k') | server/internal/logdog/collector/collector.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/internal/logdog/archivist/archivist.go
diff --git a/server/internal/logdog/archivist/archivist.go b/server/internal/logdog/archivist/archivist.go
index b2bc5ecf75c516251421dbb009f5e08d181efa40..72694ad4ca36bf012840b697e3e25700fdc50ad8 100644
--- a/server/internal/logdog/archivist/archivist.go
+++ b/server/internal/logdog/archivist/archivist.go
@@ -26,6 +26,7 @@ import (
"github.com/luci/luci-go/common/tsmon/distribution"
"github.com/luci/luci-go/common/tsmon/field"
"github.com/luci/luci-go/common/tsmon/metric"
+ tsmon_types "github.com/luci/luci-go/common/tsmon/types"
"github.com/luci/luci-go/server/logdog/archive"
"github.com/luci/luci-go/server/logdog/storage"
)
@@ -45,6 +46,7 @@ var (
// processed, regardless of success/failure.
tsCount = metric.NewCounter("logdog/archivist/archive/count",
"The number of archival tasks processed.",
+ tsmon_types.MetricMetadata{},
field.Bool("successful"))
// tsSize tracks the archive binary file size distribution of completed
@@ -56,6 +58,7 @@ var (
// The "stream" field is the type of log stream that is being archived.
tsSize = metric.NewCumulativeDistribution("logdog/archivist/archive/size",
"The size (in bytes) of each archive file.",
+ tsmon_types.MetricMetadata{Units: tsmon_types.Bytes},
distribution.DefaultBucketer,
field.String("archive"),
field.String("stream"))
@@ -69,6 +72,7 @@ var (
// The "stream" field is the type of log stream that is being archived.
tsTotalBytes = metric.NewCounter("logdog/archivist/archive/total_bytes",
"The total number of archived bytes.",
+ tsmon_types.MetricMetadata{Units: tsmon_types.Bytes},
field.String("archive"),
field.String("stream"))
@@ -78,6 +82,7 @@ var (
// The "stream" field is the type of log stream that is being archived.
tsLogEntries = metric.NewCumulativeDistribution("logdog/archivist/archive/log_entries",
"The total number of log entries per archive.",
+ tsmon_types.MetricMetadata{},
distribution.DefaultBucketer,
field.String("stream"))
@@ -87,6 +92,7 @@ var (
// The "stream" field is the type of log stream that is being archived.
tsTotalLogEntries = metric.NewCounter("logdog/archivist/archive/total_log_entries",
"The total number of log entries.",
+ tsmon_types.MetricMetadata{},
field.String("stream"))
)
« no previous file with comments | « server/cmd/logdog_collector/main.go ('k') | server/internal/logdog/collector/collector.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698