Documentation ¶
Index ¶
- Variables
- func LabelMatchersSort(matchers []*prompb.LabelMatcher) []*prompb.LabelMatcher
- func MetricMatches(metric StreamMetric, matchers ...*Matcher) bool
- type BadgerIndex
- type DB
- type IndexInserter
- type IndexMatcher
- type Matcher
- type StreamID
- type StreamMetric
- func (*StreamMetric) Descriptor() ([]byte, []int)
- func (m *StreamMetric) GetLabels() []prompb.Label
- func (m *StreamMetric) Marshal() (dAtA []byte, err error)
- func (m *StreamMetric) MarshalTo(dAtA []byte) (int, error)
- func (m *StreamMetric) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*StreamMetric) ProtoMessage()
- func (m *StreamMetric) Reset()
- func (m *StreamMetric) Size() (n int)
- func (m *StreamMetric) String() string
- func (sm *StreamMetric) ToPromString() string
- func (m *StreamMetric) Unmarshal(dAtA []byte) error
- func (m *StreamMetric) XXX_DiscardUnknown()
- func (m *StreamMetric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StreamMetric) XXX_Merge(src proto.Message)
- func (m *StreamMetric) XXX_Size() int
- func (m *StreamMetric) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func LabelMatchersSort ¶
func LabelMatchersSort(matchers []*prompb.LabelMatcher) []*prompb.LabelMatcher
func MetricMatches ¶
func MetricMatches(metric StreamMetric, matchers ...*Matcher) bool
Types ¶
type BadgerIndex ¶
type BadgerIndex struct {
// contains filtered or unexported fields
}
func NewBadgerIndex ¶
func NewBadgerIndex(db *badger.DB, batcher *badgerbatcher.BadgerDBBatcher) (*BadgerIndex, error)
func OpenBadgerIndex ¶
func OpenBadgerIndex(ctx context.Context, path string) (*BadgerIndex, error)
func (*BadgerIndex) Insert ¶
func (index *BadgerIndex) Insert(streamMetric StreamMetric) error
key format: |$0|sep|lable_name|sep|lable_value|stream_id name sep value sep streamIO
func (*BadgerIndex) Matches ¶
func (index *BadgerIndex) Matches(labelMatchers ...*prompb.LabelMatcher) ([]StreamMetric, error)
type DB ¶
type DB interface { IndexInserter IndexMatcher }
type IndexInserter ¶
type IndexInserter interface {
Insert(streamMetric StreamMetric) error
}
type IndexMatcher ¶
type IndexMatcher interface {
Matches(matcher ...*prompb.LabelMatcher) ([]StreamMetric, error)
}
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
func NewMatcher ¶
func NewMatcher(labelMatcher *prompb.LabelMatcher) *Matcher
func NewMatchers ¶
func NewMatchers(labelMatchers ...*prompb.LabelMatcher) []*Matcher
func (*Matcher) Matches ¶
func (matcher *Matcher) Matches(metric StreamMetric) bool
type StreamMetric ¶
type StreamMetric struct { Labels []prompb.Label `protobuf:"bytes,1,rep,name=Labels,proto3" json:"Labels"` StreamID StreamID `protobuf:"varint,2,opt,name=StreamID,proto3,customtype=StreamID" json:"StreamID"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func MetricsMatches ¶
func MetricsMatches(metrics []StreamMetric, matchers ...*Matcher) []StreamMetric
func (*StreamMetric) Descriptor ¶
func (*StreamMetric) Descriptor() ([]byte, []int)
func (*StreamMetric) GetLabels ¶
func (m *StreamMetric) GetLabels() []prompb.Label
func (*StreamMetric) Marshal ¶
func (m *StreamMetric) Marshal() (dAtA []byte, err error)
func (*StreamMetric) MarshalToSizedBuffer ¶
func (m *StreamMetric) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*StreamMetric) ProtoMessage ¶
func (*StreamMetric) ProtoMessage()
func (*StreamMetric) Reset ¶
func (m *StreamMetric) Reset()
func (*StreamMetric) Size ¶
func (m *StreamMetric) Size() (n int)
func (*StreamMetric) String ¶
func (m *StreamMetric) String() string
func (*StreamMetric) ToPromString ¶
func (sm *StreamMetric) ToPromString() string
func (*StreamMetric) Unmarshal ¶
func (m *StreamMetric) Unmarshal(dAtA []byte) error
func (*StreamMetric) XXX_DiscardUnknown ¶
func (m *StreamMetric) XXX_DiscardUnknown()
func (*StreamMetric) XXX_Marshal ¶
func (m *StreamMetric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StreamMetric) XXX_Merge ¶
func (m *StreamMetric) XXX_Merge(src proto.Message)
func (*StreamMetric) XXX_Size ¶
func (m *StreamMetric) XXX_Size() int
func (*StreamMetric) XXX_Unmarshal ¶
func (m *StreamMetric) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.