metricsmetadata

package
v1.122.21 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataStorageMetrics

type MetadataStorageMetrics struct {
	ItemsCurrent     uint64
	CurrentSizeBytes uint64
	MaxSizeBytes     uint64
}

MetadataStorageMetrics contains metrics for the storage.

type Row

type Row struct {
	MetricFamilyName []byte
	Help             []byte
	Unit             []byte

	AccountID uint32
	ProjectID uint32

	Type prompb.MetricType
	// contains filtered or unexported fields
}

Row represents time series metadata record

func UnmarshalRows

func UnmarshalRows(dst []Row, src []byte, maxRows int) ([]Row, []byte, error)

UnmarshalRows parses Rows from provided buffer according to the maxRows

returns parsed Rows and tails buffer if maxRows value was reached

func (*Row) MarshalTo

func (mr *Row) MarshalTo(dst []byte) []byte

MarshalTo serializes Row into provided buffer and returns result

func (*Row) Reset

func (mr *Row) Reset()

Reset resets Row

func (*Row) String

func (mr *Row) String() string

String implements Stringer interface

func (*Row) Unmarshal

func (mr *Row) Unmarshal(data []byte) ([]byte, error)

Unmarshal parses Row from provided buffer and returns tail buffer

type Storage

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

Storage for metrics metadata

func NewStorage

func NewStorage(maxSizeBytes int) *Storage

NewStorage returns new initialized Storage.

func (*Storage) Add

func (s *Storage) Add(rows []Row)

Add adds rows to the Storage.

func (*Storage) Get

func (s *Storage) Get(limit int, metricName string) []*Row

Get returns rows for the given limit and optional metricName

func (*Storage) GetForTenant

func (s *Storage) GetForTenant(accountID, projectID uint32, limit int, metricName string) []*Row

GetForTenant returns rows for the given tenant, limit and optional metricName

can only be used for cluster version

func (*Storage) MustClose

func (s *Storage) MustClose()

MustClose closes the storage and waits for all background tasks to finish.

func (*Storage) UpdateMetrics

func (s *Storage) UpdateMetrics(dst *MetadataStorageMetrics)

UpdateMetrics updates dst with metrics storage metrics.

Jump to

Keyboard shortcuts

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