metrics

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INDirection  = "IN"
	OUTDirection = "OUT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIStatMetrics added in v0.28.0

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

func (*APIStatMetrics) Collect added in v0.28.0

func (a *APIStatMetrics) Collect(ch chan<- prometheus.Metric)

func (*APIStatMetrics) CurrentS3RequestsDec added in v0.28.0

func (a *APIStatMetrics) CurrentS3RequestsDec(api string)

func (*APIStatMetrics) CurrentS3RequestsInc added in v0.28.0

func (a *APIStatMetrics) CurrentS3RequestsInc(api string)

func (*APIStatMetrics) Describe added in v0.28.0

func (a *APIStatMetrics) Describe(ch chan<- *prometheus.Desc)

func (*APIStatMetrics) RequestDurationsUpdate added in v0.28.0

func (a *APIStatMetrics) RequestDurationsUpdate(api string, durationSecs float64)

func (*APIStatMetrics) TotalInputBytesAdd added in v0.28.0

func (a *APIStatMetrics) TotalInputBytesAdd(val uint64)

func (*APIStatMetrics) TotalOutputBytesAdd added in v0.28.0

func (a *APIStatMetrics) TotalOutputBytesAdd(val uint64)

func (*APIStatMetrics) TotalS3ErrorsInc added in v0.28.0

func (a *APIStatMetrics) TotalS3ErrorsInc(api string)

func (*APIStatMetrics) TotalS3RequestsInc added in v0.28.0

func (a *APIStatMetrics) TotalS3RequestsInc(api string)

type AppMetrics

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

func NewAppMetrics

func NewAppMetrics(cfg AppMetricsConfig) *AppMetrics

func (*AppMetrics) Gather added in v0.28.0

func (m *AppMetrics) Gather() ([]*dto.MetricFamily, error)

func (*AppMetrics) Handler

func (m *AppMetrics) Handler() http.Handler

func (*AppMetrics) MarkHealthy added in v0.28.0

func (m *AppMetrics) MarkHealthy(endpoint string)

func (*AppMetrics) MarkUnhealthy added in v0.28.0

func (m *AppMetrics) MarkUnhealthy(endpoint string)

func (*AppMetrics) SetEnabled

func (m *AppMetrics) SetEnabled(enabled bool)

func (*AppMetrics) Shutdown

func (m *AppMetrics) Shutdown()

func (*AppMetrics) State added in v0.28.0

func (m *AppMetrics) State() *StateMetrics

func (*AppMetrics) Statistic added in v0.28.0

func (m *AppMetrics) Statistic() *APIStatMetrics

func (*AppMetrics) UsersAPIStats added in v0.29.0

func (m *AppMetrics) UsersAPIStats() *UsersAPIStats

type AppMetricsConfig added in v0.29.0

type AppMetricsConfig struct {
	Logger         *zap.Logger
	PoolStatistics StatisticScraper
	TreeStatistic  TreePoolStatistic
	Registerer     prometheus.Registerer
	Enabled        bool
}

type Description added in v0.28.0

type Description struct {
	Type           dto.MetricType
	Namespace      string
	Subsystem      string
	Name           string
	Help           string
	ConstantLabels prometheus.Labels
	VariableLabels []string
}

func DescribeAll added in v0.28.0

func DescribeAll() []Description

DescribeAll returns descriptions for metrics.

func (*Description) BuildFQName added in v0.28.0

func (d *Description) BuildFQName() string

func (*Description) MarshalJSON added in v0.28.0

func (d *Description) MarshalJSON() ([]byte, error)

type GateMetrics

type GateMetrics struct {
	State      *StateMetrics
	Pool       *poolMetricsCollector
	Billing    *billingMetrics
	Stats      *APIStatMetrics
	HTTPServer *httpServerMetrics
	TreePool   *treePoolMetricsCollector
	// contains filtered or unexported fields
}

func NewGateMetrics

func NewGateMetrics(scraper StatisticScraper, treeScraper TreePoolStatistic, registry prometheus.Registerer) *GateMetrics

func (*GateMetrics) Gather added in v0.28.0

func (g *GateMetrics) Gather() ([]*dto.MetricFamily, error)

func (*GateMetrics) Handler

func (g *GateMetrics) Handler() http.Handler

func (*GateMetrics) Unregister

func (g *GateMetrics) Unregister()

type HealthStatus

type HealthStatus int32

HealthStatus of the gate application.

const (
	HealthStatusUndefined    HealthStatus = 0
	HealthStatusStarting     HealthStatus = 1
	HealthStatusReady        HealthStatus = 2
	HealthStatusShuttingDown HealthStatus = 3
)

type OperationList

type OperationList [6]int

type RequestType added in v0.28.0

type RequestType int
const (
	UNKNOWNRequest RequestType = iota
	HEADRequest    RequestType = iota
	PUTRequest     RequestType = iota
	LISTRequest    RequestType = iota
	GETRequest     RequestType = iota
	DELETERequest  RequestType = iota
)

func (RequestType) String added in v0.28.0

func (t RequestType) String() string

type StateMetrics added in v0.28.0

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

func (*StateMetrics) Collect added in v0.28.0

func (m *StateMetrics) Collect(ch chan<- prometheus.Metric)

func (*StateMetrics) Describe added in v0.28.0

func (m *StateMetrics) Describe(desc chan<- *prometheus.Desc)

func (*StateMetrics) SetHealth added in v0.28.0

func (m *StateMetrics) SetHealth(s HealthStatus)

func (*StateMetrics) SetVersion added in v0.28.0

func (m *StateMetrics) SetVersion(ver string)

type StatisticScraper

type StatisticScraper interface {
	Statistic() pool.Statistic
}

type TrafficType

type TrafficType int
const (
	UnknownTraffic TrafficType = iota
	INTraffic      TrafficType = iota
	OUTTraffic     TrafficType = iota
)

func (TrafficType) String

func (t TrafficType) String() string

type TreePoolStatistic added in v0.31.0

type TreePoolStatistic interface {
	Statistic() tree.Statistic
}

type UserBucketInfo

type UserBucketInfo struct {
	User        string
	Bucket      string
	ContainerID string
	Namespace   string
}

type UserMetrics

type UserMetrics struct {
	Requests []UserMetricsInfo
	Traffic  []UserTrafficMetricsInfo
}

type UserMetricsInfo

type UserMetricsInfo struct {
	UserBucketInfo
	Operation RequestType
	Requests  int
}

type UserTrafficMetricsInfo

type UserTrafficMetricsInfo struct {
	UserBucketInfo
	Type  TrafficType
	Value uint64
}

type UsersAPIStats

type UsersAPIStats struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*UsersAPIStats) DumpMetrics

func (u *UsersAPIStats) DumpMetrics() UserMetrics

func (*UsersAPIStats) Update

func (u *UsersAPIStats) Update(user, bucket, cnrID, ns string, reqType RequestType, in, out uint64)

Jump to

Keyboard shortcuts

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