metrics

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeldonModelMetric         = "model"
	SeldonInternalModelMetric = "model_internal"
	SeldonServerMetric        = "server"
	SeldonServerReplicaMetric = "server_replica"
	MethodTypeMetric          = "method_type"
	MethodTypeRest            = "rest"
	MethodTypeGrpc            = "grpc"
	MethodMetric              = "method"
	CodeMetric                = "code"
)

Metric labels

View Source
const (
	SeldonPipelineMetric = "pipeline"
)

Docs End Metrics Keep above line as used in docs Metric labels

Variables

View Source
var (
	DefaultHistogramBuckets = []float64{0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10}
)

Functions

func HttpCodeToString

func HttpCodeToString(code int) string

Types

type AgentMetricsHandler

type AgentMetricsHandler interface {
	AddModelHistogramMetricsHandler(baseHandler http.HandlerFunc) http.HandlerFunc
	UnaryServerInterceptor() func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
	AddModelInferMetrics(externalModelName string, internalModelName string, method string, elapsedTime float64, code string)
	AddLoadedModelMetrics(internalModelName string, memory uint64, isLoad, isSoft bool)
	AddServerReplicaMetrics(memory uint64, memoryWithOvercommit float32)
}

TODO Revisit splitting this interface as metric handling matures

type PipelineMetricsHandler

type PipelineMetricsHandler interface {
	AddPipelineInferMetrics(pipelineName string, method string, elapsedTime float64, code string)
}

TODO Revisit splitting this interface as metric handling matures

type PrometheusMetrics

type PrometheusMetrics struct {
	// contains filtered or unexported fields
}

func NewPrometheusModelMetrics

func NewPrometheusModelMetrics(serverName string, serverReplicaIdx uint, logger log.FieldLogger) (*PrometheusMetrics, error)

func (*PrometheusMetrics) AddLoadedModelMetrics

func (pm *PrometheusMetrics) AddLoadedModelMetrics(internalModelName string, memBytes uint64, isLoad, isSoft bool)

func (*PrometheusMetrics) AddModelHistogramMetricsHandler

func (pm *PrometheusMetrics) AddModelHistogramMetricsHandler(baseHandler http.HandlerFunc) http.HandlerFunc

func (*PrometheusMetrics) AddModelInferMetrics

func (pm *PrometheusMetrics) AddModelInferMetrics(externalModelName string, internalModelName string, method string, latency float64, code string)

func (*PrometheusMetrics) AddServerReplicaMetrics

func (pm *PrometheusMetrics) AddServerReplicaMetrics(memory uint64, memoryWithOvercommit float32)

func (*PrometheusMetrics) Start

func (pm *PrometheusMetrics) Start(port int) error

func (*PrometheusMetrics) Stop

func (pm *PrometheusMetrics) Stop() error

func (*PrometheusMetrics) UnaryServerInterceptor

func (pm *PrometheusMetrics) UnaryServerInterceptor() func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

type PrometheusPipelineMetrics

type PrometheusPipelineMetrics struct {
	// contains filtered or unexported fields
}

func NewPrometheusPipelineMetrics

func NewPrometheusPipelineMetrics(logger log.FieldLogger) (*PrometheusPipelineMetrics, error)

func (*PrometheusPipelineMetrics) AddPipelineInferMetrics

func (pm *PrometheusPipelineMetrics) AddPipelineInferMetrics(pipelineName string, method string, latency float64, code string)

func (*PrometheusPipelineMetrics) HttpCodeToString

func (pm *PrometheusPipelineMetrics) HttpCodeToString(code int) string

func (*PrometheusPipelineMetrics) Start

func (pm *PrometheusPipelineMetrics) Start(port int) error

func (*PrometheusPipelineMetrics) Stop

func (pm *PrometheusPipelineMetrics) Stop() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL