Documentation
¶
Overview ¶
Package streams defines types used for the data object streams section. The streams section holds a list of streams present in the data object.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics instruments the streams section.
func NewMetrics ¶
func NewMetrics() *Metrics
NewMetrics creates a new set of metrics for the streams section.
func (*Metrics) Register ¶
func (m *Metrics) Register(reg prometheus.Registerer) error
Register registers metrics to report to reg.
func (*Metrics) Unregister ¶
func (m *Metrics) Unregister(reg prometheus.Registerer)
Unregister unregisters metrics from the provided Registerer.
type Stream ¶
type Stream struct {
// ID to uniquely represent a stream in a data object. Valid IDs start at 1.
// IDs are used to track streams across multiple sections in the same data
// object.
ID int64
Labels labels.Labels // Stream labels.
MinTimestamp time.Time // Minimum timestamp in the stream.
MaxTimestamp time.Time // Maximum timestamp in the stream.
Rows int // Number of rows in the stream.
}
A Stream is an individual stream within a data object.
type Streams ¶
type Streams struct {
// contains filtered or unexported fields
}
Streams tracks information about streams in a data object.
func New ¶
New creates a new Streams section. The pageSize argument specifies how large pages should be.
func (*Streams) EncodeTo ¶
EncodeTo encodes the list of recorded streams to the provided encoder.
EncodeTo may generate multiple sections if the list of streams is too big to fit into a single section.
Streams.Reset is invoked after encoding, even if encoding fails.
func (*Streams) EstimatedSize ¶
EstimatedSize returns the estimated size of the Streams section in bytes.
func (*Streams) Record ¶
Record a stream record within the Streams section. The provided timestamp is used to track the minimum and maximum timestamp of a stream. The number of calls to Record is used to track the number of rows for a stream.
The stream ID of the recorded stream is returned.