aboutsummaryrefslogtreecommitdiff
path: root/internal/lsp/debug/metrics.go
diff options
context:
space:
mode:
authorIan Cottrell <iancottrell@google.com>2020-04-20 15:44:34 -0400
committerIan Cottrell <iancottrell@google.com>2020-04-23 18:13:33 +0000
commitc81623a0cb29ea6eb049bad0ed741d5399b1c578 (patch)
tree1d46a987e0e3ce6cc8e1a4c74b57c13b8bf7565b /internal/lsp/debug/metrics.go
parent7b212d60a147f93d1af51bcc1a27181ba1f3f9f6 (diff)
downloadgolang-x-tools-c81623a0cb29ea6eb049bad0ed741d5399b1c578.tar.gz
internal/event: move event/core.Tag to event/label.Label
Also moves core.Key to label.Key, but leaves the implementations behind for now. After using for a while, the word Tag conveys slightly the wrong concept, tagging implies the entire set of information, label maps better to a single named piece of information. A label is just a named key/value pair, it is not really tied to the event package, separating it makes it much easier to understand the public symbols of the event and core packages, and allows us to also move the key implementations somewhere else, which otherwise dominate the API. Change-Id: I46275d531cec91e28af6ab1e74a2713505d52533 Reviewed-on: https://go-review.googlesource.com/c/tools/+/229239 Run-TryBot: Ian Cottrell <iancottrell@google.com> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'internal/lsp/debug/metrics.go')
-rw-r--r--internal/lsp/debug/metrics.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/lsp/debug/metrics.go b/internal/lsp/debug/metrics.go
index 94b582ead..8efc1d495 100644
--- a/internal/lsp/debug/metrics.go
+++ b/internal/lsp/debug/metrics.go
@@ -5,8 +5,8 @@
package debug
import (
- "golang.org/x/tools/internal/event/core"
"golang.org/x/tools/internal/event/export/metric"
+ "golang.org/x/tools/internal/event/label"
"golang.org/x/tools/internal/lsp/debug/tag"
)
@@ -18,34 +18,34 @@ var (
receivedBytes = metric.HistogramInt64{
Name: "received_bytes",
Description: "Distribution of received bytes, by method.",
- Keys: []core.Key{tag.RPCDirection, tag.Method},
+ Keys: []label.Key{tag.RPCDirection, tag.Method},
Buckets: bytesDistribution,
}
sentBytes = metric.HistogramInt64{
Name: "sent_bytes",
Description: "Distribution of sent bytes, by method.",
- Keys: []core.Key{tag.RPCDirection, tag.Method},
+ Keys: []label.Key{tag.RPCDirection, tag.Method},
Buckets: bytesDistribution,
}
latency = metric.HistogramFloat64{
Name: "latency",
Description: "Distribution of latency in milliseconds, by method.",
- Keys: []core.Key{tag.RPCDirection, tag.Method},
+ Keys: []label.Key{tag.RPCDirection, tag.Method},
Buckets: millisecondsDistribution,
}
started = metric.Scalar{
Name: "started",
Description: "Count of RPCs started by method.",
- Keys: []core.Key{tag.RPCDirection, tag.Method},
+ Keys: []label.Key{tag.RPCDirection, tag.Method},
}
completed = metric.Scalar{
Name: "completed",
Description: "Count of RPCs completed by method and status.",
- Keys: []core.Key{tag.RPCDirection, tag.Method, tag.StatusCode},
+ Keys: []label.Key{tag.RPCDirection, tag.Method, tag.StatusCode},
}
)