Documentation
¶
Overview ¶
Package point implements datakits basic data structure.
Index ¶
- Constants
- Variables
- func AnyRaw(x *types.Any) (any, error)
- func AppendPBPointToPBPointsPayload(dst []byte, pb *PBPoint) []byte
- func AppendPointToPBPointsPayload(dst []byte, pt *Point) []byte
- func ClearPointPool()
- func GetCfg(opts ...Option) *cfg
- func MustAnyRaw(x *types.Any) any
- func MustNewAny(x proto.Message) *types.Any
- func MustNewAnyArray(a ...any) *types.Any
- func MustNewBoolArray(b ...bool) *types.Any
- func MustNewBytesArray(bytes ...[]byte) *types.Any
- func MustNewFloatArray[T float32 | float64](f ...T) *types.Any
- func MustNewIntArray[T int8 | int16 | int | int32 | int64](i ...T) *types.Any
- func MustNewStringArray(s ...string) *types.Any
- func MustNewUintArray[T uint16 | uint | uint32 | uint64](i ...T) *types.Any
- func NewAny(x proto.Message) (*types.Any, error)
- func NewAnyArray(a ...any) (*types.Any, error)
- func NewBoolArray(b ...bool) (*types.Any, error)
- func NewBytesArray(bytes ...[]byte) (*types.Any, error)
- func NewFloatArray[T float32 | float64](f ...T) (*types.Any, error)
- func NewIntArray[T int8 | int16 | int | int32 | int64](i ...T) (*types.Any, error)
- func NewRander(opts ...RandOption) *ptRander
- func NewStringArray(s ...string) (*types.Any, error)
- func NewUintArray[T uint16 | uint | uint32 | uint64](i ...T) (*types.Any, error)
- func PB2LP(pb []byte) (lp []byte, err error)
- func PutCfg(c *cfg)
- func PutDecoder(d *Decoder)
- func PutEncoder(e *Encoder)
- func SetPointPool(pp PointPool)
- func SortByTime(pts []*Point)
- func WalkPBPointsPayload(payload []byte, fn func(rawPBPoint []byte) bool) error
- type AnyDemo
- func (*AnyDemo) Descriptor() ([]byte, []int)
- func (this *AnyDemo) Equal(that interface{}) bool
- func (m *AnyDemo) GetDemo() string
- func (this *AnyDemo) GoString() string
- func (m *AnyDemo) Marshal() (dAtA []byte, err error)
- func (m *AnyDemo) MarshalTo(dAtA []byte) (int, error)
- func (m *AnyDemo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*AnyDemo) ProtoMessage()
- func (m *AnyDemo) Reset()
- func (m *AnyDemo) Size() (n int)
- func (this *AnyDemo) String() string
- func (m *AnyDemo) Unmarshal(dAtA []byte) error
- func (m *AnyDemo) XXX_DiscardUnknown()
- func (m *AnyDemo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AnyDemo) XXX_Merge(src proto.Message)
- func (m *AnyDemo) XXX_Size() int
- func (m *AnyDemo) XXX_Unmarshal(b []byte) error
- type Array
- func (*Array) Descriptor() ([]byte, []int)
- func (this *Array) Equal(that interface{}) bool
- func (m *Array) GetArr() []*BasicTypes
- func (this *Array) GoString() string
- func (m *Array) Marshal() (dAtA []byte, err error)
- func (m *Array) MarshalTo(dAtA []byte) (int, error)
- func (m *Array) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Array) ProtoMessage()
- func (m *Array) Reset()
- func (m *Array) Size() (n int)
- func (this *Array) String() string
- func (m *Array) Unmarshal(dAtA []byte) error
- func (m *Array) XXX_DiscardUnknown()
- func (m *Array) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Array) XXX_Merge(src proto.Message)
- func (m *Array) XXX_Size() int
- func (m *Array) XXX_Unmarshal(b []byte) error
- type BasicTypes
- func (*BasicTypes) Descriptor() ([]byte, []int)
- func (this *BasicTypes) Equal(that interface{}) bool
- func (m *BasicTypes) GetB() bool
- func (m *BasicTypes) GetD() []byte
- func (m *BasicTypes) GetF() float64
- func (m *BasicTypes) GetI() int64
- func (m *BasicTypes) GetS() string
- func (m *BasicTypes) GetU() uint64
- func (m *BasicTypes) GetX() isBasicTypes_X
- func (this *BasicTypes) GoString() string
- func (m *BasicTypes) Marshal() (dAtA []byte, err error)
- func (m *BasicTypes) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*BasicTypes) ProtoMessage()
- func (m *BasicTypes) Reset()
- func (m *BasicTypes) Size() (n int)
- func (this *BasicTypes) String() string
- func (m *BasicTypes) Unmarshal(dAtA []byte) error
- func (m *BasicTypes) XXX_DiscardUnknown()
- func (m *BasicTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BasicTypes) XXX_Merge(src proto.Message)
- func (*BasicTypes) XXX_OneofWrappers() []interface{}
- func (m *BasicTypes) XXX_Size() int
- func (m *BasicTypes) XXX_Unmarshal(b []byte) error
- type BasicTypes_B
- func (this *BasicTypes_B) Equal(that interface{}) bool
- func (this *BasicTypes_B) GoString() string
- func (m *BasicTypes_B) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_B) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_B) Size() (n int)
- func (this *BasicTypes_B) String() string
- type BasicTypes_D
- func (this *BasicTypes_D) Equal(that interface{}) bool
- func (this *BasicTypes_D) GoString() string
- func (m *BasicTypes_D) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_D) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_D) Size() (n int)
- func (this *BasicTypes_D) String() string
- type BasicTypes_F
- func (this *BasicTypes_F) Equal(that interface{}) bool
- func (this *BasicTypes_F) GoString() string
- func (m *BasicTypes_F) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_F) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_F) Size() (n int)
- func (this *BasicTypes_F) String() string
- type BasicTypes_I
- func (this *BasicTypes_I) Equal(that interface{}) bool
- func (this *BasicTypes_I) GoString() string
- func (m *BasicTypes_I) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_I) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_I) Size() (n int)
- func (this *BasicTypes_I) String() string
- type BasicTypes_S
- func (this *BasicTypes_S) Equal(that interface{}) bool
- func (this *BasicTypes_S) GoString() string
- func (m *BasicTypes_S) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_S) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_S) Size() (n int)
- func (this *BasicTypes_S) String() string
- type BasicTypes_U
- func (this *BasicTypes_U) Equal(that interface{}) bool
- func (this *BasicTypes_U) GoString() string
- func (m *BasicTypes_U) MarshalTo(dAtA []byte) (int, error)
- func (m *BasicTypes_U) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *BasicTypes_U) Size() (n int)
- func (this *BasicTypes_U) String() string
- type BatchPoints
- type Callback
- type Category
- type Debug
- func (*Debug) Descriptor() ([]byte, []int)
- func (this *Debug) Equal(that interface{}) bool
- func (m *Debug) GetInfo() string
- func (this *Debug) GoString() string
- func (m *Debug) Marshal() (dAtA []byte, err error)
- func (m *Debug) MarshalTo(dAtA []byte) (int, error)
- func (m *Debug) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Debug) ProtoMessage()
- func (m *Debug) Reset()
- func (m *Debug) Size() (n int)
- func (this *Debug) String() string
- func (m *Debug) Unmarshal(dAtA []byte) error
- func (m *Debug) XXX_DiscardUnknown()
- func (m *Debug) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Debug) XXX_Merge(src proto.Message)
- func (m *Debug) XXX_Size() int
- func (m *Debug) XXX_Unmarshal(b []byte) error
- type DecodeFn
- type Decoder
- type DecoderOption
- type EncodeFn
- type Encoder
- func (e *Encoder) Encode(pts []*Point) ([][]byte, error)
- func (e *Encoder) EncodeV2(pts []*Point)
- func (e *Encoder) LastErr() error
- func (e *Encoder) LastTrimmed() int
- func (e *Encoder) Next(buf []byte) ([]byte, bool)
- func (e *Encoder) SkippedPoints() int
- func (e *Encoder) String() string
- func (e *Encoder) TotalPoints() int
- type EncoderOption
- type Encoding
- type EqualOption
- type Field
- func (*Field) Descriptor() ([]byte, []int)
- func (this *Field) Equal(that interface{}) bool
- func (m *Field) GetA() *types.Any
- func (m *Field) GetB() bool
- func (m *Field) GetD() []byte
- func (m *Field) GetDescription() string
- func (m *Field) GetF() float64
- func (m *Field) GetI() int64
- func (m *Field) GetIsTag() bool
- func (m *Field) GetKey() string
- func (m *Field) GetS() string
- func (m *Field) GetType() MetricType
- func (m *Field) GetU() uint64
- func (m *Field) GetUnit() string
- func (m *Field) GetVal() isField_Val
- func (this *Field) GoString() string
- func (m *Field) Marshal() (dAtA []byte, err error)
- func (m *Field) MarshalTo(dAtA []byte) (int, error)
- func (m *Field) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Field) ProtoMessage()
- func (kv *Field) Raw() any
- func (m *Field) Reset()
- func (m *Field) Size() (n int)
- func (this *Field) String() string
- func (m *Field) Unmarshal(dAtA []byte) error
- func (m *Field) XXX_DiscardUnknown()
- func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Field) XXX_Merge(src proto.Message)
- func (*Field) XXX_OneofWrappers() []interface{}
- func (m *Field) XXX_Size() int
- func (m *Field) XXX_Unmarshal(b []byte) error
- type Field_A
- type Field_B
- type Field_D
- type Field_F
- type Field_I
- type Field_S
- type Field_U
- type JSONPoint
- type KVOption
- type KVs
- func (x KVs) Add(k string, v any, opts ...KVOption) KVs
- func (x KVs) AddKV(kv *Field) KVs
- func (x KVs) AddTag(k, v string) KVs
- func (x KVs) Del(k string) KVs
- func (x KVs) FieldCount() (i int)
- func (x KVs) Fields() (arr KVs)
- func (x KVs) Get(k string) *Field
- func (x KVs) GetTag(k string) string
- func (x KVs) Has(k string) bool
- func (x KVs) InfluxFields() map[string]any
- func (x KVs) InfluxTags() (res influxm.Tags)
- func (x KVs) Keys() *Keys
- func (x KVs) Len() int
- func (x KVs) Less(i, j int) bool
- func (x KVs) Pretty() string
- func (x KVs) PrettySorted() string
- func (x KVs) RawPretty() string
- func (x KVs) Reset()
- func (x KVs) ResetFull()
- func (x KVs) Set(k string, v any, opts ...KVOption) KVs
- func (x KVs) SetKV(kv *Field) KVs
- func (x KVs) SetTag(k, v string) KVs
- func (x KVs) Swap(i, j int)
- func (x KVs) TagCount() (i int)
- func (x KVs) Tags() (arr KVs)
- func (x KVs) TrimFields(n int) (arr KVs)
- func (x KVs) TrimTags(n int) (arr KVs)
- type Key
- type KeyType
- type Keys
- type Map
- func (*Map) Descriptor() ([]byte, []int)
- func (this *Map) Equal(that interface{}) bool
- func (m *Map) GetMap() map[string]*BasicTypes
- func (this *Map) GoString() string
- func (m *Map) Marshal() (dAtA []byte, err error)
- func (m *Map) MarshalTo(dAtA []byte) (int, error)
- func (m *Map) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Map) ProtoMessage()
- func (m *Map) Reset()
- func (m *Map) Size() (n int)
- func (this *Map) String() string
- func (m *Map) Unmarshal(dAtA []byte) error
- func (m *Map) XXX_DiscardUnknown()
- func (m *Map) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Map) XXX_Merge(src proto.Message)
- func (m *Map) XXX_Size() int
- func (m *Map) XXX_Unmarshal(b []byte) error
- type MetricType
- type Option
- func CommonLoggingOptions() []Option
- func DefaultLoggingOptions() []Option
- func DefaultMetricOptions() []Option
- func DefaultMetricOptionsForInflux1X() []Option
- func DefaultObjectOptions() []Option
- func WithCallback(fn Callback) Option
- func WithDisabledKeys(keys ...*Key) Option
- func WithDotInKey(on bool) Option
- func WithEncoding(enc Encoding) Option
- func WithExtraTags(tags map[string]string) Option
- func WithKeySorted(on bool) Option
- func WithMaxFieldKeyLen(n int) Option
- func WithMaxFieldValLen(n int) Option
- func WithMaxFields(n int) Option
- func WithMaxKVComposeLen(n int) Option
- func WithMaxMeasurementLen(n int) Option
- func WithMaxTagKeyLen(n int) Option
- func WithMaxTagValLen(n int) Option
- func WithMaxTags(n int) Option
- func WithPrecheck(on bool) Option
- func WithPrecision(p Precision) Option
- func WithRequiredKeys(keys ...*Key) Option
- func WithStrField(on bool) Option
- func WithTime(t time.Time) Option
- func WithTimestamp(ts int64) Option
- func WithU64Field(on bool) Option
- type PBPoint
- func (*PBPoint) Descriptor() ([]byte, []int)
- func (this *PBPoint) Equal(that interface{}) bool
- func (m *PBPoint) GetDebugs() []*Debug
- func (m *PBPoint) GetFields() []*Field
- func (m *PBPoint) GetName() string
- func (m *PBPoint) GetTime() int64
- func (m *PBPoint) GetWarns() []*Warn
- func (this *PBPoint) GoString() string
- func (m *PBPoint) Marshal() (dAtA []byte, err error)
- func (m *PBPoint) MarshalTo(dAtA []byte) (int, error)
- func (m *PBPoint) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PBPoint) ProtoMessage()
- func (m *PBPoint) Reset()
- func (m *PBPoint) Size() (n int)
- func (this *PBPoint) String() string
- func (m *PBPoint) Unmarshal(dAtA []byte) error
- func (m *PBPoint) XXX_DiscardUnknown()
- func (m *PBPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PBPoint) XXX_Merge(src proto.Message)
- func (m *PBPoint) XXX_Size() int
- func (m *PBPoint) XXX_Unmarshal(b []byte) error
- type PBPoints
- func (*PBPoints) Descriptor() ([]byte, []int)
- func (this *PBPoints) Equal(that interface{}) bool
- func (m *PBPoints) GetArr() []*PBPoint
- func (this *PBPoints) GoString() string
- func (m *PBPoints) Marshal() (dAtA []byte, err error)
- func (m *PBPoints) MarshalTo(dAtA []byte) (int, error)
- func (m *PBPoints) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PBPoints) ProtoMessage()
- func (m *PBPoints) Reset()
- func (m *PBPoints) Size() (n int)
- func (this *PBPoints) String() string
- func (m *PBPoints) Unmarshal(dAtA []byte) error
- func (m *PBPoints) XXX_DiscardUnknown()
- func (m *PBPoints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PBPoints) XXX_Merge(src proto.Message)
- func (m *PBPoints) XXX_Size() int
- func (m *PBPoints) XXX_Unmarshal(b []byte) error
- type Point
- func CheckPoints(pts []*Point, opts ...Option) (arr []*Point)
- func FromModelsLP(lp influxm.Point) *Point
- func FromPB(pb *PBPoint) *Point
- func FromPBJson(j []byte) (*Point, error)
- func GatherPoints(reg prometheus.Gatherer) ([]*Point, error)
- func MustFromPBJson(j []byte) *Point
- func NewLPPoint(lp influxm.Point) *Point
- func NewPoint(name string, kvs KVs, opts ...Option) *Point
- func NewPointDeprecated(name string, tags map[string]string, fields map[string]any, opts ...Option) (*Point, error)deprecated
- func RandPoints(count int) []*Point
- func WrapPB(pt *Point, pb *PBPoint) *Point
- func WrapPoint(pts []influxm.Point) (arr []*Point)
- func (p *Point) Add(k string, v any)
- func (p *Point) AddDebug(d *Debug)
- func (p *Point) AddKVs(kvs ...*Field)
- func (p *Point) AddTag(k, v string)
- func (p *Point) ClearFlag(f uint64)
- func (p *Point) CopyField(kvs ...*Field)
- func (p *Point) CopyTags(kvs ...*Field)
- func (p *Point) Del(k string)
- func (p *Point) Equal(x *Point, opts ...EqualOption) bool
- func (p *Point) EqualWithReason(x *Point, opts ...EqualOption) (bool, string)
- func (p *Point) Fields() (arr KVs)
- func (p *Point) Get(k string) any
- func (p *Point) GetA(k string) (*types.Any, bool)
- func (p *Point) GetB(k string) (bool, bool)
- func (p *Point) GetD(k string) ([]byte, bool)
- func (p *Point) GetF(k string) (float64, bool)
- func (p *Point) GetI(k string) (int64, bool)
- func (p *Point) GetS(k string) (string, bool)
- func (p *Point) GetTag(k string) string
- func (p *Point) GetU(k string) (uint64, bool)
- func (p *Point) HasFlag(f uint) bool
- func (p *Point) InfluxFields() map[string]any
- func (p *Point) InfluxTags() influxm.Tags
- func (p *Point) KVMap() map[string]any
- func (p *Point) KVs() (arr KVs)
- func (p *Point) Keys() *Keys
- func (p *Point) LPPoint() (influxm.Point, error)
- func (p *Point) LPSize() int
- func (p *Point) LineProto(prec ...Precision) string
- func (p *Point) MD5() string
- func (p *Point) MapTags() map[string]string
- func (p *Point) MarshalJSON() ([]byte, error)
- func (p *Point) MustAdd(k string, v any)
- func (p *Point) MustAddKVs(kvs ...*Field)
- func (p *Point) MustLPPoint() influxm.Point
- func (p *Point) Name() string
- func (p *Point) PBJson() ([]byte, error)
- func (p *Point) PBJsonPretty() ([]byte, error)
- func (p *Point) PBPoint() *PBPoint
- func (p *Point) PBSize() int
- func (p *Point) Pretty() string
- func (p *Point) Reset()
- func (p *Point) Set(k string, v any)
- func (p *Point) SetFlag(f uint)
- func (p *Point) SetKVs(kvs ...*Field)
- func (p *Point) SetName(name string)
- func (p *Point) SetTag(k, v string)
- func (p *Point) SetTime(t time.Time)
- func (p *Point) Sha256() string
- func (p *Point) Size() int
- func (p *Point) Tags() (arr KVs)
- func (p *Point) Time() time.Time
- func (p *Point) TimeSeriesHash() []string
- func (p *Point) UnmarshalJSON(j []byte) error
- func (p *Point) Warns() []*Warn
- func (p *Point) WarnsPretty() string
- type PointPool
- type Points
- type Precision
- type RandOption
- func WithCategory(c Category) RandOption
- func WithFixedKeys(on bool) RandOption
- func WithFixedTags(on bool) RandOption
- func WithKVSorted(on bool) RandOption
- func WithRandFields(n int) RandOption
- func WithRandKeyLen(n int) RandOption
- func WithRandMeasurementPrefix(s string) RandOption
- func WithRandPB(on bool) RandOption
- func WithRandSampleText(st []string) RandOption
- func WithRandStringValues(on bool) RandOption
- func WithRandTags(n int) RandOption
- func WithRandText(n int) RandOption
- func WithRandTime(t time.Time) RandOption
- func WithRandValLen(n int) RandOption
- type ReservedCapPointPool
- func (cpp *ReservedCapPointPool) Collect(ch chan<- p8s.Metric)
- func (cpp *ReservedCapPointPool) Describe(ch chan<- *p8s.Desc)
- func (cpp *ReservedCapPointPool) Get() *Point
- func (cpp *ReservedCapPointPool) GetKV(k string, v any) *Field
- func (cpp *ReservedCapPointPool) Put(p *Point)
- func (cpp *ReservedCapPointPool) PutKV(f *Field)
- func (cpp *ReservedCapPointPool) String() string
- type Warn
- func (*Warn) Descriptor() ([]byte, []int)
- func (this *Warn) Equal(that interface{}) bool
- func (m *Warn) GetMsg() string
- func (m *Warn) GetType() string
- func (this *Warn) GoString() string
- func (m *Warn) Marshal() (dAtA []byte, err error)
- func (m *Warn) MarshalTo(dAtA []byte) (int, error)
- func (m *Warn) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Warn) ProtoMessage()
- func (m *Warn) Reset()
- func (m *Warn) Size() (n int)
- func (this *Warn) String() string
- func (m *Warn) Unmarshal(dAtA []byte) error
- func (m *Warn) XXX_DiscardUnknown()
- func (m *Warn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Warn) XXX_Merge(src proto.Message)
- func (m *Warn) XXX_Size() int
- func (m *Warn) XXX_Unmarshal(b []byte) error
Constants ¶
const ( ArrayFieldType = "type.googleapis.com/point.Array" DictFieldType = "type.googleapis.com/point.Map" )
const ( UnknownCategory Category = iota DynamicDWCategory MetricDeprecated Metric Network KeyEvent Object ObjectChange CustomObject Logging Tracing RUM Security Profiling DialTesting ExecutionLog LLM AgentLLM SUnknownCategory = "unknown" SDynamicDWCategory = "dynamic_dw" // NOTE: not used SMetric = "metric" SMetricDeprecated = "metrics" SNetwork = "network" SKeyEvent = "keyevent" SObject = "object" SObjectChange = "object_change" SCustomObject = "custom_object" SLogging = "logging" STracing = "tracing" SRUM = "rum" SSecurity = "security" SProfiling = "profiling" SDialTesting = "dialtesting" SExecutionLog = "execution_log" SLlm = "llm" SAgentLLM = "agent_llm" URLUnknownCategory = "/v1/write/unknown" URLDynamicDWCategory = "/v1/write/dynamic_dw" // NOTE: not used URLMetric = "/v1/write/metric" URLMetricDeprecated = "/v1/write/metrics" URLNetwork = "/v1/write/network" URLKeyEvent = "/v1/write/keyevent" URLObject = "/v1/write/object" URLObjectChange = "/v1/write/object_change" URLCustomObject = "/v1/write/custom_object" URLLogging = "/v1/write/logging" URLTracing = "/v1/write/tracing" URLRUM = "/v1/write/rum" URLSecurity = "/v1/write/security" URLProfiling = "/v1/write/profiling" URLDialTesting = "/v1/write/dialtesting" // NOTE: not used URLExecutionLog = "/v1/write/siem_logging" URLLlm = "/v1/write/langfuse-v2" URLAgentLLM = "/v1/write/agent_llm" CUnknown = "UNKNOWN" CDynamicDW = "DYNAMIC_DW" CM = "M" CN = "N" CE = "E" CO = "O" COCH = "OCH" CCO = "CO" CL = "L" CT = "T" CR = "R" CS = "S" CP = "P" CDT = "DT" CEL = "EL" CLlm = "LLM" CAgentLLM = "AL" )
const ( EnvDefaultEncoding = "ENV_DEFAULT_ENCODING" EnvEnableMixedArrayField = "ENV_ENABLE_MIXED_ARRAY_FIELD" EnvEnableDictField = "ENV_ENABLE_DICT_FIELD" )
const ( WarnMaxTags = "exceed_max_tags" WarnMaxFields = "exceed_max_fields" WarnNoField = "no_field" WarnMaxTagKeyLen = "exceed_max_tag_key_len" WarnMaxTagValueLen = "exceed_max_tag_value_len" WarnMaxFieldKeyLen = "exceed_max_field_key_len" WarnMaxFieldValueLen = "exceed_max_field_value_len" WarnMaxFieldValueInt = "exceed_max_field_value_int" WarnInfConvertToMaxValue = "convert_inf_to_max_value" WarnInfConvertToMinValue = "convert_inf_to_min_value" WarnInvalidUTF8String = "invalid_utf8_string" WarnMaxTagKeyValueCompose = "exceed_max_tag_key_value_compose" WarnInvalidTagKey = "invalid_tag_key" WarnInvalidTagValue = "invalid_tag_value" WarnInvalidMeasurement = "invalid_measurement" WarnInvalidFieldValueType = "invalid_field_value_type" WarnAddRequiredKV = "add_required_kv" WarnFieldDisabled = "field_disabled" WarnTagDisabled = "tag_disabled" WarnSameTagFieldKey = "same_tag_field_key" WarnKeyNameConflict = "key_name_conflict" WarnDotInkey = "dot_in_key" WarnNROrTailEscape = "found_new_line_or_tail_espace" WarnFieldB64Encoded = "field_base64_encoded" WarnNilField = "nil_field" )
Point warnnings.
const ( Psent = 1 << iota // The Point has been sent Ppb // the point is Protobuf point Pcheck // checked Ppooled // from point pool )
const (
DefaultLoggingStatus = "info"
)
Variables ¶
var ( // EnableMixedArrayField and EnableDictField used to allow mix-typed array and dict/map // value in point field. // // Currently, GuanceDB backend do NOT support mix-typed array and dict. EnableMixedArrayField = false EnableDictField = false )
var ( ErrNoFields = errors.New("no fields") ErrInvalidLineProtocol = errors.New("invalid lineprotocol") )
var ( ErrInvalidLengthPoint = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPoint = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupPoint = fmt.Errorf("proto: unexpected end of group") )
var ( DefaultMeasurementName = "__default" KeyTime = NewKey("time", I) KeyMeasurement = NewKey("measurement", S) KeySource = NewKey("source", S) KeyClass = NewKey("class", S) KeyDate = NewKey("date", I) KeyName = NewKey("name", S, defaultObjectName) KeyStatus = NewKey("status", S, DefaultLoggingStatus) )
var (
DefaultEncoding = LineProtocol
)
var KeyType_name = map[int32]string{
0: "X",
1: "I",
2: "U",
3: "F",
4: "B",
5: "D",
6: "NIL",
7: "S",
8: "A",
}
var KeyType_value = map[string]int32{
"X": 0,
"I": 1,
"U": 2,
"F": 3,
"B": 4,
"D": 5,
"NIL": 6,
"S": 7,
"A": 8,
}
var MetricType_name = map[int32]string{
0: "UNSPECIFIED",
1: "COUNT",
2: "RATE",
3: "GAUGE",
10: "SUM_DELTA",
11: "SUM_CUMULATIVE",
12: "SUMMARY_COUNT",
13: "SUMMARY_SUM",
14: "SUMMARY_QUANTILE",
20: "HISTOGRAM_MAX",
21: "HISTOGRAM_MIN",
22: "HISTOGRAM_COUNT",
23: "HISTOGRAM_SUM",
24: "HISTOGRAM_BUCKET_COUNTS",
25: "HISTOGRAM_BUCKET_BOUNDS",
30: "EXPONENTIAL_HISTOGRAM_MAX",
31: "EXPONENTIAL_HISTOGRAM_MIN",
32: "EXPONENTIAL_HISTOGRAM_COUNT",
33: "EXPONENTIAL_HISTOGRAM_SUM",
34: "EXPONENTIAL_HISTOGRAM_AVG",
35: "EXPONENTIAL_HISTOGRAM_SCALE",
36: "EXPONENTIAL_HISTOGRAM_ZERO_COUNT",
37: "EXPONENTIAL_HISTOGRAM_POS_OFFSET",
38: "EXPONENTIAL_HISTOGRAM_POS_BUCKET_COUNTS",
39: "EXPONENTIAL_HISTOGRAM_NEG_OFFSET",
40: "EXPONENTIAL_HISTOGRAM_NEG_BUCKET_COUNTS",
41: "EXPONENTIAL_HISTOGRAM_FLAGS",
42: "EXPONENTIAL_HISTOGRAM_START_TIME",
}
var MetricType_value = map[string]int32{
"UNSPECIFIED": 0,
"COUNT": 1,
"RATE": 2,
"GAUGE": 3,
"SUM_DELTA": 10,
"SUM_CUMULATIVE": 11,
"SUMMARY_COUNT": 12,
"SUMMARY_SUM": 13,
"SUMMARY_QUANTILE": 14,
"HISTOGRAM_MAX": 20,
"HISTOGRAM_MIN": 21,
"HISTOGRAM_COUNT": 22,
"HISTOGRAM_SUM": 23,
"HISTOGRAM_BUCKET_COUNTS": 24,
"HISTOGRAM_BUCKET_BOUNDS": 25,
"EXPONENTIAL_HISTOGRAM_MAX": 30,
"EXPONENTIAL_HISTOGRAM_MIN": 31,
"EXPONENTIAL_HISTOGRAM_COUNT": 32,
"EXPONENTIAL_HISTOGRAM_SUM": 33,
"EXPONENTIAL_HISTOGRAM_AVG": 34,
"EXPONENTIAL_HISTOGRAM_SCALE": 35,
"EXPONENTIAL_HISTOGRAM_ZERO_COUNT": 36,
"EXPONENTIAL_HISTOGRAM_POS_OFFSET": 37,
"EXPONENTIAL_HISTOGRAM_POS_BUCKET_COUNTS": 38,
"EXPONENTIAL_HISTOGRAM_NEG_OFFSET": 39,
"EXPONENTIAL_HISTOGRAM_NEG_BUCKET_COUNTS": 40,
"EXPONENTIAL_HISTOGRAM_FLAGS": 41,
"EXPONENTIAL_HISTOGRAM_START_TIME": 42,
}
Functions ¶
func AppendPBPointToPBPointsPayload ¶
AppendPBPointToPBPointsPayload appends one PBPoint into a PBPoints payload.
func AppendPointToPBPointsPayload ¶
AppendPointToPBPointsPayload appends one point into a PBPoints payload.
func ClearPointPool ¶
func ClearPointPool()
func MustAnyRaw ¶
MustAnyRaw get underlying wrapped value, and panic if any error.
func MustNewAny ¶
MustNewAny create anypb based on exist proto message, and panic if any error.
func MustNewAnyArray ¶
MustNewAnyArray wrapped mix-basic-typed list into types.Any, and panic if any error.
func MustNewBoolArray ¶
MustNewBoolArray wrapped boolean list into types.Any, and panic if any error.
func MustNewBytesArray ¶
MustNewBytesArray wrapped string list into types.Any, and panic if any error.
func MustNewFloatArray ¶
MustNewFloatArray wrapped float list into types.Any, and panic if any error.
func MustNewIntArray ¶
MustNewIntArray wrapped signed int list into types.Any, and panic if any error.
func MustNewStringArray ¶
MustNewStringArray wrapped string list into types.Any, and panic if any error.
func MustNewUintArray ¶
MustNewUintArray wrapped unsigned int list into types.Any, and panic if any error.
func NewAnyArray ¶
NewAnyArray wrapped mix-basic-typed list into types.Any.
func NewBoolArray ¶
NewBoolArray wrapped boolean list into types.Any.
func NewBytesArray ¶
NewBytesArray wrapped string list into types.Any.
func NewFloatArray ¶
NewFloatArray wrapped float list into types.Any.
func NewIntArray ¶
NewIntArray wrapped signed int list into types.Any.
func NewRander ¶
func NewRander(opts ...RandOption) *ptRander
func NewStringArray ¶
NewStringArray wrapped string list into types.Any.
func NewUintArray ¶
NewUintArray wrapped unsigned int list into types.Any.
func PutDecoder ¶
func PutDecoder(d *Decoder)
func PutEncoder ¶
func PutEncoder(e *Encoder)
func SetPointPool ¶
func SetPointPool(pp PointPool)
Types ¶
type AnyDemo ¶
type AnyDemo struct {
Demo string `protobuf:"bytes,1,opt,name=demo,proto3" json:"demo,omitempty"`
}
example of pb.Any
func (*AnyDemo) Descriptor ¶
func (*AnyDemo) MarshalToSizedBuffer ¶
func (*AnyDemo) ProtoMessage ¶
func (*AnyDemo) ProtoMessage()
func (*AnyDemo) XXX_DiscardUnknown ¶
func (m *AnyDemo) XXX_DiscardUnknown()
func (*AnyDemo) XXX_Marshal ¶
func (*AnyDemo) XXX_Unmarshal ¶
type Array ¶
type Array struct {
Arr []*BasicTypes `protobuf:"bytes,1,rep,name=arr,proto3" json:"arr,omitempty"`
}
func NewArray ¶
NewArray create array value that can be used in point field. The types within ents can be mixed basic types.
func (*Array) Descriptor ¶
func (*Array) GetArr ¶
func (m *Array) GetArr() []*BasicTypes
func (*Array) ProtoMessage ¶
func (*Array) ProtoMessage()
func (*Array) XXX_DiscardUnknown ¶
func (m *Array) XXX_DiscardUnknown()
func (*Array) XXX_Marshal ¶
func (*Array) XXX_Unmarshal ¶
type BasicTypes ¶
type BasicTypes struct {
// Types that are valid to be assigned to X:
//
// *BasicTypes_I
// *BasicTypes_U
// *BasicTypes_F
// *BasicTypes_B
// *BasicTypes_D
// *BasicTypes_S
X isBasicTypes_X `protobuf_oneof:"x"`
}
func (*BasicTypes) Descriptor ¶
func (*BasicTypes) Descriptor() ([]byte, []int)
func (*BasicTypes) Equal ¶
func (this *BasicTypes) Equal(that interface{}) bool
func (*BasicTypes) GetB ¶
func (m *BasicTypes) GetB() bool
func (*BasicTypes) GetD ¶
func (m *BasicTypes) GetD() []byte
func (*BasicTypes) GetF ¶
func (m *BasicTypes) GetF() float64
func (*BasicTypes) GetI ¶
func (m *BasicTypes) GetI() int64
func (*BasicTypes) GetS ¶
func (m *BasicTypes) GetS() string
func (*BasicTypes) GetU ¶
func (m *BasicTypes) GetU() uint64
func (*BasicTypes) GetX ¶
func (m *BasicTypes) GetX() isBasicTypes_X
func (*BasicTypes) GoString ¶
func (this *BasicTypes) GoString() string
func (*BasicTypes) Marshal ¶
func (m *BasicTypes) Marshal() (dAtA []byte, err error)
func (*BasicTypes) MarshalToSizedBuffer ¶
func (m *BasicTypes) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes) ProtoMessage ¶
func (*BasicTypes) ProtoMessage()
func (*BasicTypes) Reset ¶
func (m *BasicTypes) Reset()
func (*BasicTypes) Size ¶
func (m *BasicTypes) Size() (n int)
func (*BasicTypes) String ¶
func (this *BasicTypes) String() string
func (*BasicTypes) Unmarshal ¶
func (m *BasicTypes) Unmarshal(dAtA []byte) error
func (*BasicTypes) XXX_DiscardUnknown ¶
func (m *BasicTypes) XXX_DiscardUnknown()
func (*BasicTypes) XXX_Marshal ¶
func (m *BasicTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BasicTypes) XXX_Merge ¶
func (m *BasicTypes) XXX_Merge(src proto.Message)
func (*BasicTypes) XXX_OneofWrappers ¶
func (*BasicTypes) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*BasicTypes) XXX_Size ¶
func (m *BasicTypes) XXX_Size() int
func (*BasicTypes) XXX_Unmarshal ¶
func (m *BasicTypes) XXX_Unmarshal(b []byte) error
type BasicTypes_B ¶
type BasicTypes_B struct {
B bool `protobuf:"varint,4,opt,name=b,proto3,oneof" json:"b,omitempty"`
}
func (*BasicTypes_B) Equal ¶
func (this *BasicTypes_B) Equal(that interface{}) bool
func (*BasicTypes_B) GoString ¶
func (this *BasicTypes_B) GoString() string
func (*BasicTypes_B) MarshalToSizedBuffer ¶
func (m *BasicTypes_B) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_B) Size ¶
func (m *BasicTypes_B) Size() (n int)
func (*BasicTypes_B) String ¶
func (this *BasicTypes_B) String() string
type BasicTypes_D ¶
type BasicTypes_D struct {
D []byte `protobuf:"bytes,5,opt,name=d,proto3,oneof" json:"d,omitempty"`
}
func (*BasicTypes_D) Equal ¶
func (this *BasicTypes_D) Equal(that interface{}) bool
func (*BasicTypes_D) GoString ¶
func (this *BasicTypes_D) GoString() string
func (*BasicTypes_D) MarshalToSizedBuffer ¶
func (m *BasicTypes_D) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_D) Size ¶
func (m *BasicTypes_D) Size() (n int)
func (*BasicTypes_D) String ¶
func (this *BasicTypes_D) String() string
type BasicTypes_F ¶
type BasicTypes_F struct {
F float64 `protobuf:"fixed64,3,opt,name=f,proto3,oneof" json:"f,omitempty"`
}
func (*BasicTypes_F) Equal ¶
func (this *BasicTypes_F) Equal(that interface{}) bool
func (*BasicTypes_F) GoString ¶
func (this *BasicTypes_F) GoString() string
func (*BasicTypes_F) MarshalToSizedBuffer ¶
func (m *BasicTypes_F) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_F) Size ¶
func (m *BasicTypes_F) Size() (n int)
func (*BasicTypes_F) String ¶
func (this *BasicTypes_F) String() string
type BasicTypes_I ¶
type BasicTypes_I struct {
I int64 `protobuf:"varint,1,opt,name=i,proto3,oneof" json:"i,omitempty"`
}
func (*BasicTypes_I) Equal ¶
func (this *BasicTypes_I) Equal(that interface{}) bool
func (*BasicTypes_I) GoString ¶
func (this *BasicTypes_I) GoString() string
func (*BasicTypes_I) MarshalToSizedBuffer ¶
func (m *BasicTypes_I) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_I) Size ¶
func (m *BasicTypes_I) Size() (n int)
func (*BasicTypes_I) String ¶
func (this *BasicTypes_I) String() string
type BasicTypes_S ¶
type BasicTypes_S struct {
S string `protobuf:"bytes,6,opt,name=s,proto3,oneof" json:"s,omitempty"`
}
func (*BasicTypes_S) Equal ¶
func (this *BasicTypes_S) Equal(that interface{}) bool
func (*BasicTypes_S) GoString ¶
func (this *BasicTypes_S) GoString() string
func (*BasicTypes_S) MarshalToSizedBuffer ¶
func (m *BasicTypes_S) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_S) Size ¶
func (m *BasicTypes_S) Size() (n int)
func (*BasicTypes_S) String ¶
func (this *BasicTypes_S) String() string
type BasicTypes_U ¶
type BasicTypes_U struct {
U uint64 `protobuf:"varint,2,opt,name=u,proto3,oneof" json:"u,omitempty"`
}
func (*BasicTypes_U) Equal ¶
func (this *BasicTypes_U) Equal(that interface{}) bool
func (*BasicTypes_U) GoString ¶
func (this *BasicTypes_U) GoString() string
func (*BasicTypes_U) MarshalToSizedBuffer ¶
func (m *BasicTypes_U) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BasicTypes_U) Size ¶
func (m *BasicTypes_U) Size() (n int)
func (*BasicTypes_U) String ¶
func (this *BasicTypes_U) String() string
type BatchPoints ¶
type BatchPoints struct {
Points []*Point
// contains filtered or unexported fields
}
func NewBatchPoints ¶
func NewBatchPoints() *BatchPoints
func (*BatchPoints) Release ¶
func (bp *BatchPoints) Release()
func (*BatchPoints) Reset ¶
func (bp *BatchPoints) Reset()
func (*BatchPoints) Unmarshal ¶
func (bp *BatchPoints) Unmarshal(src []byte) (err error)
type Debug ¶
type Debug struct {
Info string `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"`
}
Debug used to attached some debug info for the point, these debug info will encoded into payload, storage can take optional handle on these debug info.
func (*Debug) Descriptor ¶
func (*Debug) ProtoMessage ¶
func (*Debug) ProtoMessage()
func (*Debug) XXX_DiscardUnknown ¶
func (m *Debug) XXX_DiscardUnknown()
func (*Debug) XXX_Marshal ¶
func (*Debug) XXX_Unmarshal ¶
type DecodeFn ¶
DecodeFn used to iterate on []*Point payload, if error returned, the iterate terminated.
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func GetDecoder ¶
func GetDecoder(opts ...DecoderOption) *Decoder
func (*Decoder) DetailedError ¶
type DecoderOption ¶
type DecoderOption func(e *Decoder)
func WithDecEasyproto ¶
func WithDecEasyproto(on bool) DecoderOption
func WithDecEncoding ¶
func WithDecEncoding(enc Encoding) DecoderOption
func WithDecFn ¶
func WithDecFn(fn DecodeFn) DecoderOption
type EncodeFn ¶
EncodeFn used to iterate on []*Point payload, if error returned, the iterate terminated.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func GetEncoder ¶
func GetEncoder(opts ...EncoderOption) *Encoder
func (*Encoder) Encode ¶
Encode get bytes form of multiple Points, often used to Write to somewhere(file/network/...), batchSize used to split huge points into multiple part. Set batchSize to 0 to disable the split.
func (*Encoder) LastTrimmed ¶
func (*Encoder) Next ¶
Next is a iterator that return encoded data in prepared buf. If all points encoded done, return false. If any error occurred, we can get the error by call e.LastErr().
func (*Encoder) SkippedPoints ¶
func (*Encoder) TotalPoints ¶
type EncoderOption ¶
type EncoderOption func(e *Encoder)
func WithApproxSize ¶
func WithApproxSize(on bool) EncoderOption
WithApproxSize used to calculate the not-precise bytes required for protobuf encoding. Default to true for better performance under busy encoding conditions.
func WithEncBatchBytes ¶
func WithEncBatchBytes(bytes int) EncoderOption
func WithEncBatchSize ¶
func WithEncBatchSize(size int) EncoderOption
func WithEncEncoding ¶
func WithEncEncoding(enc Encoding) EncoderOption
func WithEncFn ¶
func WithEncFn(fn EncodeFn) EncoderOption
func WithIgnoreLargePoint ¶
func WithIgnoreLargePoint(on bool) EncoderOption
WithIgnoreLargePoint will skip too-large point that can't encoded into buffer.
type Encoding ¶
type Encoding int
func EncodingStr ¶
EncodingStr convert encoding-string in configure file to encoding enum.
Here v1/v2 are alias for lineprotocol and protobuf, this makes people easy to switch between lineprotocol and protobuf. For json, you should not configure json encoding in production environments(json do not classify int and float).
func HTTPContentType ¶
HTTPContentType detect HTTP body content encoding according to header Content-Type.
func (Encoding) HTTPContentType ¶
HTTPContentType get correct HTTP Content-Type value on different body encoding.
type EqualOption ¶
type EqualOption func(*eqopt)
func EqualWithMeasurement ¶
func EqualWithMeasurement(on bool) EqualOption
EqualWithMeasurement set compare on points with/without measurement.
func EqualWithoutKeys ¶
func EqualWithoutKeys(keys ...string) EqualOption
EqualWithoutKeys set compare on points without specific keys.
type Field ¶
type Field struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// See https://developers.google.com/protocol-buffers/docs/proto3#json
//
// Types that are valid to be assigned to Val:
//
// *Field_I
// *Field_U
// *Field_F
// *Field_B
// *Field_D
// *Field_S
// *Field_A
Val isField_Val `protobuf_oneof:"val"`
IsTag bool `protobuf:"varint,8,opt,name=is_tag,proto3" json:"is_tag,omitempty"`
Type MetricType `protobuf:"varint,9,opt,name=type,proto3,enum=point.MetricType" json:"type,omitempty"`
// field unit name
Unit string `protobuf:"bytes,10,opt,name=unit,proto3" json:"unit,omitempty"`
Description string `protobuf:"bytes,12,opt,name=description,proto3" json:"description,omitempty"`
}
func (*Field) Descriptor ¶
func (*Field) GetDescription ¶
func (*Field) GetType ¶
func (m *Field) GetType() MetricType
func (*Field) ProtoMessage ¶
func (*Field) ProtoMessage()
func (*Field) XXX_DiscardUnknown ¶
func (m *Field) XXX_DiscardUnknown()
func (*Field) XXX_Marshal ¶
func (*Field) XXX_OneofWrappers ¶
func (*Field) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*Field) XXX_Unmarshal ¶
type Field_A ¶
type Field_A struct {
A *types.Any `protobuf:"bytes,7,opt,name=a,proto3,oneof" json:"a,omitempty"`
}
func (*Field_A) MarshalToSizedBuffer ¶
type Field_B ¶
type Field_B struct {
B bool `protobuf:"varint,5,opt,name=b,proto3,oneof" json:"b,omitempty"`
}
func (*Field_B) MarshalToSizedBuffer ¶
type Field_D ¶
type Field_D struct {
D []byte `protobuf:"bytes,6,opt,name=d,proto3,oneof" json:"d,omitempty"`
}
func (*Field_D) MarshalToSizedBuffer ¶
type Field_F ¶
type Field_F struct {
F float64 `protobuf:"fixed64,4,opt,name=f,proto3,oneof" json:"f,omitempty"`
}
func (*Field_F) MarshalToSizedBuffer ¶
type Field_I ¶
type Field_I struct {
I int64 `protobuf:"varint,2,opt,name=i,proto3,oneof" json:"i,omitempty"`
}
func (*Field_I) MarshalToSizedBuffer ¶
type Field_S ¶
type Field_S struct {
S string `protobuf:"bytes,11,opt,name=s,proto3,oneof" json:"s,omitempty"`
}
func (*Field_S) MarshalToSizedBuffer ¶
type Field_U ¶
type Field_U struct {
U uint64 `protobuf:"varint,3,opt,name=u,proto3,oneof" json:"u,omitempty"`
}
func (*Field_U) MarshalToSizedBuffer ¶
type JSONPoint ¶
type KVOption ¶
type KVOption func(kv *Field)
func WithKVTagSet ¶
func WithKVType ¶
func WithKVType(t MetricType) KVOption
WithKVType set field type(count/gauge/rate).
type KVs ¶
type KVs []*Field
func (KVs) FieldCount ¶
func (KVs) InfluxFields ¶
InfluxFields convert KVs to map structure.
func (KVs) InfluxTags ¶
InfluxTags convert tag KVs to map structure.
func (KVs) PrettySorted ¶
func (KVs) TrimFields ¶
TrimFields keep max-n field kvs and drop the rest.
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is the key-name and it's type composite.
type Map ¶
type Map struct {
Map map[string]*BasicTypes `` /* 147-byte string literal not displayed */
}
func MustNewMap ¶
MustNewMap create map value that can be used in point field, and panic if any error.
func (*Map) Descriptor ¶
func (*Map) GetMap ¶
func (m *Map) GetMap() map[string]*BasicTypes
func (*Map) ProtoMessage ¶
func (*Map) ProtoMessage()
func (*Map) XXX_DiscardUnknown ¶
func (m *Map) XXX_DiscardUnknown()
func (*Map) XXX_Unmarshal ¶
type MetricType ¶
type MetricType int32
const ( // 0~9 UNSPECIFIED MetricType = 0 COUNT MetricType = 1 RATE MetricType = 2 GAUGE MetricType = 3 // 10~19 SUM_DELTA MetricType = 10 SUM_CUMULATIVE MetricType = 11 SUMMARY_COUNT MetricType = 12 SUMMARY_SUM MetricType = 13 SUMMARY_QUANTILE MetricType = 14 // 20~29 HISTOGRAM_MAX MetricType = 20 HISTOGRAM_MIN MetricType = 21 HISTOGRAM_COUNT MetricType = 22 HISTOGRAM_SUM MetricType = 23 HISTOGRAM_BUCKET_COUNTS MetricType = 24 HISTOGRAM_BUCKET_BOUNDS MetricType = 25 // 30 ~ 49 EXPONENTIAL_HISTOGRAM_MAX MetricType = 30 EXPONENTIAL_HISTOGRAM_MIN MetricType = 31 EXPONENTIAL_HISTOGRAM_COUNT MetricType = 32 EXPONENTIAL_HISTOGRAM_SUM MetricType = 33 EXPONENTIAL_HISTOGRAM_AVG MetricType = 34 EXPONENTIAL_HISTOGRAM_SCALE MetricType = 35 EXPONENTIAL_HISTOGRAM_ZERO_COUNT MetricType = 36 EXPONENTIAL_HISTOGRAM_POS_OFFSET MetricType = 37 EXPONENTIAL_HISTOGRAM_POS_BUCKET_COUNTS MetricType = 38 EXPONENTIAL_HISTOGRAM_NEG_OFFSET MetricType = 39 EXPONENTIAL_HISTOGRAM_NEG_BUCKET_COUNTS MetricType = 40 EXPONENTIAL_HISTOGRAM_FLAGS MetricType = 41 EXPONENTIAL_HISTOGRAM_START_TIME MetricType = 42 )
func (MetricType) EnumDescriptor ¶
func (MetricType) EnumDescriptor() ([]byte, []int)
func (MetricType) String ¶
func (x MetricType) String() string
type Option ¶
type Option func(*cfg)
func CommonLoggingOptions ¶
func CommonLoggingOptions() []Option
CommonLoggingOptions defined options on RUM/Tracing/Security/Event/Profile/Network point.
func DefaultLoggingOptions ¶
func DefaultLoggingOptions() []Option
DefaultLoggingOptions defined options on Logging point.
func DefaultMetricOptions ¶
func DefaultMetricOptions() []Option
DefaultMetricOptions defined options on Metric point.
func DefaultMetricOptionsForInflux1X ¶
func DefaultMetricOptionsForInflux1X() []Option
DefaultMetricOptionsForInflux1X get influxdb 1.x options. For influxdb 1.x, uint64 not support.
func DefaultObjectOptions ¶
func DefaultObjectOptions() []Option
DefaultObjectOptions defined options on Object/CustomObject point.
func WithCallback ¶
func WithDisabledKeys ¶
func WithDotInKey ¶
func WithEncoding ¶
func WithExtraTags ¶
func WithKeySorted ¶
func WithMaxFieldKeyLen ¶
func WithMaxFieldValLen ¶
func WithMaxFields ¶
func WithMaxKVComposeLen ¶
func WithMaxMeasurementLen ¶
func WithMaxTagKeyLen ¶
func WithMaxTagValLen ¶
func WithMaxTags ¶
func WithPrecheck ¶
func WithPrecision ¶
func WithRequiredKeys ¶
func WithStrField ¶
func WithTimestamp ¶
func WithU64Field ¶
type PBPoint ¶
type PBPoint struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"`
Time int64 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"`
// Auxiliary fields for the point, they should not
// write to the final storage on production.
Warns []*Warn `protobuf:"bytes,4,rep,name=warns,proto3" json:"warns,omitempty"`
Debugs []*Debug `protobuf:"bytes,5,rep,name=debugs,proto3" json:"debugs,omitempty"`
}
func (*PBPoint) Descriptor ¶
func (*PBPoint) MarshalToSizedBuffer ¶
func (*PBPoint) ProtoMessage ¶
func (*PBPoint) ProtoMessage()
func (*PBPoint) XXX_DiscardUnknown ¶
func (m *PBPoint) XXX_DiscardUnknown()
func (*PBPoint) XXX_Marshal ¶
func (*PBPoint) XXX_Unmarshal ¶
type PBPoints ¶
type PBPoints struct {
Arr []*PBPoint `protobuf:"bytes,1,rep,name=arr,proto3" json:"arr,omitempty"`
}
batch of pbpoint.
func (*PBPoints) Descriptor ¶
func (*PBPoints) MarshalToSizedBuffer ¶
func (*PBPoints) ProtoMessage ¶
func (*PBPoints) ProtoMessage()
func (*PBPoints) XXX_DiscardUnknown ¶
func (m *PBPoints) XXX_DiscardUnknown()
func (*PBPoints) XXX_Marshal ¶
func (*PBPoints) XXX_Unmarshal ¶
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
func CheckPoints ¶
CheckPoints used to check pts on various opts.
func FromModelsLP ¶
func FromPBJson ¶
func GatherPoints ¶
func GatherPoints(reg prometheus.Gatherer) ([]*Point, error)
GatherPoints gather all metrics in global registry, but convert these metrics to Point.
func MustFromPBJson ¶
func NewLPPoint ¶
NewLPPoint create Point based on a lineproto point.
func NewPointDeprecated
deprecated
func NewPointDeprecated(name string, tags map[string]string, fields map[string]any, opts ...Option) (*Point, error)
NewPointDeprecated returns a new Point given name(measurement), tags, fields and optional options.
If fields empty(or nil), error ErrNoField will returned.
Values in fields only allowed for int/uint(8-bit/16-bit/32-bit/64-bit), string, bool, float(32-bit/64-bit) and []byte, other types are ignored.
Deprecated: use NewPoint.
func (*Point) Equal ¶
func (p *Point) Equal(x *Point, opts ...EqualOption) bool
Equal test if two point are the same. Equality test NOT check on warns and debugs. If two points equal, they have the same ID(MD5/Sha256), but same ID do not means they are equal.
func (*Point) EqualWithReason ¶
func (p *Point) EqualWithReason(x *Point, opts ...EqualOption) (bool, string)
func (*Point) InfluxFields ¶
InfluxFields convert fields to map structure.
func (*Point) InfluxTags ¶
InfluxTags convert tags to map structure.
func (*Point) LineProto ¶
LineProto convert point to text lineprotocol(both for lineproto point and protobuf point).
func (*Point) MarshalJSON ¶
MarshalJSON to protobuf json.
func (*Point) MustAddKVs ¶
MustAddKVs add kv, if the key exist, override it.
func (*Point) MustLPPoint ¶
func (*Point) PBJsonPretty ¶
func (*Point) Pretty ¶
Pretty get string representation of point, all key-valus will be sorted in output.
func (*Point) Size ¶
Size get underling data size in byte(exclude warning/debug info).
NOTE: This is a approxmate size, not equal to the final protobuf size of the point. For precise size, use PBSize() instead(and is slower).
func (*Point) TimeSeriesHash ¶
func (*Point) UnmarshalJSON ¶
UnmarshalJSON unmarshal protobuf json.
func (*Point) WarnsPretty ¶
WarnsPretty return human readable warnning info.
type PointPool ¶
type PointPool interface {
Get() *Point
Put(*Point)
GetKV(k string, v any) *Field
PutKV(f *Field)
// For prometheus metrics.
p8s.Collector
}
func GetPointPool ¶
func GetPointPool() PointPool
func NewReservedCapPointPool ¶
type RandOption ¶
type RandOption func(*ptRander)
func WithCategory ¶
func WithCategory(c Category) RandOption
func WithFixedKeys ¶
func WithFixedKeys(on bool) RandOption
func WithFixedTags ¶
func WithFixedTags(on bool) RandOption
func WithKVSorted ¶
func WithKVSorted(on bool) RandOption
func WithRandFields ¶
func WithRandFields(n int) RandOption
func WithRandKeyLen ¶
func WithRandKeyLen(n int) RandOption
func WithRandMeasurementPrefix ¶
func WithRandMeasurementPrefix(s string) RandOption
func WithRandPB ¶
func WithRandPB(on bool) RandOption
func WithRandSampleText ¶
func WithRandSampleText(st []string) RandOption
func WithRandStringValues ¶
func WithRandStringValues(on bool) RandOption
func WithRandTags ¶
func WithRandTags(n int) RandOption
func WithRandText ¶
func WithRandText(n int) RandOption
func WithRandTime ¶
func WithRandTime(t time.Time) RandOption
func WithRandValLen ¶
func WithRandValLen(n int) RandOption
type ReservedCapPointPool ¶
type ReservedCapPointPool struct {
// contains filtered or unexported fields
}
func (*ReservedCapPointPool) Collect ¶
func (cpp *ReservedCapPointPool) Collect(ch chan<- p8s.Metric)
func (*ReservedCapPointPool) Describe ¶
func (cpp *ReservedCapPointPool) Describe(ch chan<- *p8s.Desc)
func (*ReservedCapPointPool) Get ¶
func (cpp *ReservedCapPointPool) Get() *Point
func (*ReservedCapPointPool) Put ¶
func (cpp *ReservedCapPointPool) Put(p *Point)
func (*ReservedCapPointPool) PutKV ¶
func (cpp *ReservedCapPointPool) PutKV(f *Field)
func (*ReservedCapPointPool) String ¶
func (cpp *ReservedCapPointPool) String() string
type Warn ¶
type Warn struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
Msg string `protobuf:"bytes,2,opt,name=msg,json=message,proto3" json:"msg,omitempty"`
}
Warn used to attach some warning message during building the point.
func (*Warn) Descriptor ¶
func (*Warn) ProtoMessage ¶
func (*Warn) ProtoMessage()
func (*Warn) XXX_DiscardUnknown ¶
func (m *Warn) XXX_DiscardUnknown()