Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( AttrStatusSuccess = attribute.String("status", "success") AttrStatusError = attribute.String("status", "error-other") AttrStatusPanic = attribute.String("status", "error-panic") AttrStatusCanceled = attribute.String("status", "error-canceled") AttrStatusTimeout = attribute.String("status", "error-timeout") AttrStatusInternalError = attribute.String("status", "error-internal") AttrStatusNotFound = attribute.String("status", "error-not-found") AttrDialSucceeded = attribute.Key("dial-succeeded") )
Functions ¶
func NewMeteredDatastore ¶
func NewMeteredDatastore(meter metric.Meter, metricsPrefix string, delegate datastore.Datastore) datastore.Datastore
NewMeteredDatastore wraps the delegate with metrics, measuring latency and bytes exchanged depending on the operation.
Types ¶
type SampleSet ¶
type SampleSet struct {
// contains filtered or unexported fields
}
SampleSet stores a bounded set of samples and exposes the ability to check whether it contains a given sample. See SampleSet.contains.
Internally, SampleSet uses two maps to store samples, each of which can grow up to the specified max size. When one map fills up, the SampleSet switches to the other, effectively flipping between them. This allows the set to check for sample existence across a range of approximately max size to twice the max size, offering a larger sample set compared to implementations that track insertion order with similar memory footprint.
The worst case memory footprint of SampleSet is around 2 * maxSize * 96 bytes.
func NewSampleSet ¶
NewSampleSet creates a new SampleSet with a specified max size per sample subset.