Documentation ¶
Index ¶
- Constants
- func NewConfigMapBackedDefaultHandler(ctx context.Context) (*metricsHandler, error)
- func NewConfigMapStorage(podNamespace string, configMapClient k8s.ConfigMapInterface) *configMapStorageClient
- func NewDefaultConfigMapStorage(podNamespace string) (*configMapStorageClient, error)
- func NewDefaultMetricsHandler(storage StorageClient, merger *UsageMerger) *metricsHandler
- type CurrentTimeProvider
- type EnvoyMetrics
- type EnvoyUsage
- type GlobalUsage
- type MetricsHandler
- type Options
- type Server
- type StorageClient
- type UsageMerger
Constants ¶
View Source
const ( ReadConfigStatPrefix = "read_config" PrometheusStatPrefix = "prometheus" ServerUptime = "server.uptime" TcpStatPrefix = "tcp" HttpStatPrefix = "http" ListenerStatPrefix = "listener" )
Variables ¶
This section is empty.
Functions ¶
func NewConfigMapBackedDefaultHandler ¶
get the default metrics handler backed by a config map
func NewConfigMapStorage ¶
func NewConfigMapStorage(podNamespace string, configMapClient k8s.ConfigMapInterface) *configMapStorageClient
func NewDefaultMetricsHandler ¶
func NewDefaultMetricsHandler(storage StorageClient, merger *UsageMerger) *metricsHandler
Types ¶
type CurrentTimeProvider ¶
type EnvoyMetrics ¶
type EnvoyUsage ¶
type GlobalUsage ¶
type GlobalUsage struct {
EnvoyIdToUsage map[string]*EnvoyUsage
}
type MetricsHandler ¶
type MetricsHandler interface {
HandleMetrics(context.Context, *envoymet.StreamMetricsMessage) error
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
server is used to implement envoymet.MetricsServiceServer.
func NewServer ¶
func NewServer(opts Options, handler MetricsHandler) *Server
func (*Server) StreamMetrics ¶
func (s *Server) StreamMetrics(envoyMetrics envoymet.MetricsService_StreamMetricsServer) error
type StorageClient ¶
type StorageClient interface { RecordUsage(ctx context.Context, usage *GlobalUsage) error GetUsage(ctx context.Context) (*GlobalUsage, error) }
type UsageMerger ¶
type UsageMerger struct {
// contains filtered or unexported fields
}
func NewUsageMerger ¶
func NewUsageMerger(currentTimeProvider CurrentTimeProvider) *UsageMerger
provide a way to get the current time used to make unit tests easier to write and more deterministic
func (*UsageMerger) MergeUsage ¶
func (u *UsageMerger) MergeUsage(envoyInstanceId string, oldUsage *GlobalUsage, newMetrics *EnvoyMetrics) *GlobalUsage
Source Files ¶
Click to show internal directories.
Click to hide internal directories.