blob: 29f60b4431216afb37a4162301d3b73b8e12710e [file] [log] [blame]
// Copyright 2015 The Vanadium 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 stats defines an interface to access statistical information for
// troubleshooting and monitoring purposes.
package stats
import (
"v.io/v23/security/access"
"v.io/v23/services/watch"
)
// The Stats interface is used to access stats for troubleshooting and
// monitoring purposes. The stats objects are discoverable via the Globbable
// interface and watchable via the GlobWatcher interface.
//
// The types of the object values are implementation specific, but should be
// primarily numeric in nature, e.g. counters, memory usage, latency metrics,
// etc.
type Stats interface {
// Stats objects can be watched. Updates are streamed to the watcher.
watch.GlobWatcher
// Value returns the current value of an object, or an error. The type
// of the value is implementation specific.
// Some objects may not have a value, in which case, Value() returns
// a NoValue error.
Value() (any | error) {access.Debug}
}
error (
NoValue(suffix string) {"en": "object has no value, suffix: {suffix}"}
)