Skip to content

Commit

Permalink
Comment cache field of inserter
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Feb 15, 2023
1 parent fd10cb4 commit 4b65721
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sdk/metric/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ func (p *pipeline) produce(ctx context.Context) (metricdata.ResourceMetrics, err
// inserter facilitates inserting of new instruments from a single scope into a
// pipeline.
type inserter[N int64 | float64] struct {
// cache holds the aggregators this inserter has created and the views the
// parent meter resolved.
//
// The aggregators part of the cache ensures that if this inserter has
// already created an aggregator and registered it with the underlying
// pipeline (and likewise its underlying reader), that aggregator is
// returned if a user asks the meter for an equivalent stream (directly, or
// via a view transform).
//
// The views part ensures that any instrument conflicts (i.e. same name but
// different description, unit, ...) are logged. This is done from the
// scope of the Meter by virtue of vc coming from the meter.
cache instrumentCache[N]
pipeline *pipeline
}
Expand Down

0 comments on commit 4b65721

Please sign in to comment.