Documentation
¶
Index ¶
- type MetricBuilder
- type Reader
- func (r *Reader) AttrHash(row int) uint64
- func (r *Reader) Attributes(row int, fn func(key, value string))
- func (r *Reader) Exemplars(row int, fn func(e *model.Exemplar))
- func (r *Reader) Fields(row int, fn func(name string, kind field.Type, value float64))
- func (r *Reader) Name(row int) string
- func (r *Reader) Namespace(row int) string
- func (r *Reader) NumRows() int
- func (r *Reader) Release()
- func (r *Reader) Reset(data []byte) error
- func (r *Reader) Timestamp(row int) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricBuilder ¶
type MetricBuilder struct {
// contains filtered or unexported fields
}
MetricBuilder builds metric record batches in a columnar Arrow format.
func NewMetricBuilder ¶
func NewMetricBuilder(allocator memory.Allocator) *MetricBuilder
NewMetricBuilder creates a new MetricBuilder with the given memory allocator.
func (*MetricBuilder) Append ¶
func (mb *MetricBuilder) Append(m *model.Metric)
Append appends a single metric data point to the builder. AttrHash() is called before writing attribute FKs to ensure consistent ordering.
func (*MetricBuilder) Build ¶
func (mb *MetricBuilder) Build() []arrow.RecordBatch
Build builds and returns the [attribute, metric] record batches.
func (*MetricBuilder) Bytes ¶
func (mb *MetricBuilder) Bytes() ([]byte, error)
Bytes serializes all pending metric rows into IPC bytes and resets internal state.
func (*MetricBuilder) NumOfRows ¶
func (mb *MetricBuilder) NumOfRows() int
NumOfRows returns the number of metric rows appended so far.
func (*MetricBuilder) Release ¶
func (mb *MetricBuilder) Release() error
Release releases all resources held by the MetricBuilder.
func (*MetricBuilder) Schemas ¶
func (mb *MetricBuilder) Schemas() []*arrow.Schema
Schemas returns the schemas for the [attribute, metric] record batches.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reads metric data from Arrow record batches.
func NewReader ¶
NewReader creates a Reader by deserializing IPC bytes written by MetricBuilder.Bytes().
func (*Reader) Attributes ¶
Attributes iterates over the attribute FK list for the given row, resolving each FK to a key-value pair from the attribute table and calling fn.
func (*Reader) Exemplars ¶
Exemplars iterates over the List<ExemplarType> entries for the given row, calling fn for each exemplar (nil entries are skipped).
func (*Reader) Fields ¶
Fields iterates over the List<Struct{name,kind,value}> entries for the given row, calling fn for each field. kind is the raw uint8 from the Arrow column, cast directly to field.Type — no string conversion needed.
func (*Reader) Namespace ¶
Namespace returns the namespace string for the given row (empty string if null).
func (*Reader) Release ¶
func (r *Reader) Release()
Release releases all record batches and the underlying IPC reader.