Documentation ¶
Index ¶
- Variables
- type Metrics
- type Observer
- func (obs *Observer) Finish(ctx context.Context) error
- func (obs *Observer) Fork(ctx context.Context) (rangedloop.Partial, error)
- func (obs *Observer) Join(ctx context.Context, partial rangedloop.Partial) error
- func (obs *Observer) Start(ctx context.Context, startTime time.Time) error
- func (obs *Observer) TestingMetrics() PlacementsMetrics
- type PlacementsMetrics
Constants ¶
This section is empty.
Variables ¶
var ( // Error defines the metrics chore errors class. Error = errs.Class("metrics") )
Functions ¶
This section is empty.
Types ¶
type Metrics ¶ added in v1.70.1
type Metrics struct { // RemoteObjects is the count of objects with at least one remote segment. RemoteObjects int64 // InlineObjects is the count of objects with only inline segments. InlineObjects int64 // TotalInlineBytes is the amount of bytes across all inline segments. TotalInlineBytes int64 // TotalRemoteBytes is the amount of bytes across all remote segments. TotalRemoteBytes int64 // TotalInlineSegments is the count of inline segments across all objects. TotalInlineSegments int64 // TotalRemoteSegments is the count of remote segments across all objects. TotalRemoteSegments int64 // TotalSegmentsWithExpiresAt is the count of segments that will expire automatically. TotalSegmentsWithExpiresAt int64 }
Metrics tracks metrics related to objects and segments.
type Observer ¶ added in v1.70.1
type Observer struct {
// contains filtered or unexported fields
}
Observer implements the ranged segment loop observer interface for data science metrics collection.
func NewObserver ¶ added in v1.70.1
func NewObserver() *Observer
NewObserver instantiates a new rangedloop observer which aggregates object statistics from observed segments.
func (*Observer) Fork ¶ added in v1.70.1
Fork implements the Observer method of the same name by returning a partial implementation that aggregates metrics about the observed segments/streams. These metrics will be aggregated into the observed totals during Join.
func (*Observer) Start ¶ added in v1.70.1
Start implements the Observer method of the same name by resetting the aggregated metrics.
func (*Observer) TestingMetrics ¶ added in v1.70.1
func (obs *Observer) TestingMetrics() PlacementsMetrics
TestingMetrics returns the accumulated metrics. It is intended to be called from tests.
type PlacementsMetrics ¶ added in v1.101.1
type PlacementsMetrics []Metrics
PlacementsMetrics tracks metrics related to object and segments by placement.
storj.PlacmentConstraints are the indexes of the slice.
func (*PlacementsMetrics) Aggregate ¶ added in v1.101.1
func (metrics *PlacementsMetrics) Aggregate(partial PlacementsMetrics)
Aggregate aggregates the given metrics into the receiver.
func (*PlacementsMetrics) Read ¶ added in v1.101.1
func (metrics *PlacementsMetrics) Read(cb func(_ storj.PlacementConstraint, _ Metrics))
Read reads the metrics for all the placements and calls cb for each placement and its metrics.
func (*PlacementsMetrics) Reset ¶ added in v1.101.1
func (metrics *PlacementsMetrics) Reset()
Reset resets all the metrics to zero.