Documentation ¶
Index ¶
- Constants
- Variables
- func Authenticate(keyFilePath string) (*cloudmonitoring.Service, error)
- func GetMetric(name, project string) (*cloudmonitoring.MetricDescriptor, error)
- func GetServiceMountedName(namespaceRoot, serviceName string) (string, error)
- func GetSortedMetricNames() []string
- func ResolveAndProcessServiceName(v23ctx *context.T, ctx *tool.Context, serviceName, serviceMountedName string) (map[string]naming.MountEntry, error)
- type ServiceLocation
- type StatValue
Constants ¶
const ( SNMounttable = "mounttable" SNIdentity = "identity service" SNMacaroon = "macaroon service" SNBinaryDischarger = "binary discharger" SNRole = "role service" SNProxy = "proxy service" SNBenchmark = "benchmark service" )
Human-readable service names.
const ( MNMounttableMountedServers = "mounttable mounted servers" MNMounttableNodes = "mounttable nodes" )
Human-readable metric names.
Variables ¶
var ServiceLocationMap = map[string]*ServiceLocation{ "/ns.dev.v.io:8101": &ServiceLocation{ Instance: "vanadium-cell-master", Zone: "us-central1-c", }, "/ns.dev.v.io:8151": &ServiceLocation{ Instance: "vanadium-cell-master", Zone: "us-central1-c", }, "/ns.dev.staging.v.io:8101": &ServiceLocation{ Instance: "vanadium-cell-master", Zone: "us-central1-c", }, "/ns.dev.staging.v.io:8151": &ServiceLocation{ Instance: "vanadium-cell-master", Zone: "us-central1-c", }, }
Functions ¶
func Authenticate ¶
func Authenticate(keyFilePath string) (*cloudmonitoring.Service, error)
Authenticate authenticates with the given JSON credentials file (or the default client if the file is not provided). If successful, it returns a service object that can be used in GCM API calls.
func GetMetric ¶
func GetMetric(name, project string) (*cloudmonitoring.MetricDescriptor, error)
GetMetric gets the custom metric descriptor with the given name and project.
func GetServiceMountedName ¶
GetServiceMountedName gets the full mounted name for the given service.
func GetSortedMetricNames ¶
func GetSortedMetricNames() []string
GetSortedMetricNames gets the sorted metric names.
Types ¶
type ServiceLocation ¶
func GetServiceLocation ¶
func GetServiceLocation(v23ctx *context.T, ctx *tool.Context, me naming.MountEntry) (*ServiceLocation, error)
GetServiceLocation returns the given service's location (instance and zone). If the service is replicated, the instance name is the pod name.
To make it simpler and faster, we look up service's location in hard-coded "zone maps" for both non-replicated and replicated services.
type StatValue ¶
type StatValue struct { Name string Value interface{} }
StatValue stores the name and the value returned from the GetStat function.
func GetStat ¶
func GetStat(v23ctx *context.T, ctx *tool.Context, me naming.MountEntry, pattern string) ([]*StatValue, error)
GetStat gets the given stat using rpc.