mirror of
https://github.com/golang/go
synced 2024-11-19 05:34:40 -07:00
a4a09c7216
Add a source.Scope type that can be used to refer to directories or files, and modify (*snapshot).load to take source.Scope. Then call load in NewView. Change-Id: I8f03c7b271d700b162100d2890d23219ef9578c2 Reviewed-on: https://go-review.googlesource.com/c/tools/+/204822 Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
41 lines
1.2 KiB
Go
41 lines
1.2 KiB
Go
// Copyright 2019 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Package telemetry provides the hooks and adapters to allow use of telemetry
|
|
// throughout gopls.
|
|
package telemetry
|
|
|
|
import (
|
|
"golang.org/x/tools/internal/telemetry/stats"
|
|
"golang.org/x/tools/internal/telemetry/tag"
|
|
"golang.org/x/tools/internal/telemetry/unit"
|
|
)
|
|
|
|
const (
|
|
// create the tag keys we use
|
|
Method = tag.Key("method")
|
|
StatusCode = tag.Key("status.code")
|
|
StatusMessage = tag.Key("status.message")
|
|
RPCID = tag.Key("id")
|
|
RPCDirection = tag.Key("direction")
|
|
File = tag.Key("file")
|
|
Directory = tag.Key("directory")
|
|
URI = tag.Key("URI")
|
|
Package = tag.Key("package")
|
|
PackagePath = tag.Key("package_path")
|
|
)
|
|
|
|
var (
|
|
// create the stats we measure
|
|
Started = stats.Int64("started", "Count of started RPCs.", unit.Dimensionless)
|
|
ReceivedBytes = stats.Int64("received_bytes", "Bytes received.", unit.Bytes)
|
|
SentBytes = stats.Int64("sent_bytes", "Bytes sent.", unit.Bytes)
|
|
Latency = stats.Float64("latency_ms", "Elapsed time in milliseconds", unit.Milliseconds)
|
|
)
|
|
|
|
const (
|
|
Inbound = "in"
|
|
Outbound = "out"
|
|
)
|