sketchpb

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IndexMapping_Interpolation_name = map[int32]string{
		0: "NONE",
		1: "LINEAR",
		2: "QUADRATIC",
		3: "CUBIC",
	}
	IndexMapping_Interpolation_value = map[string]int32{
		"NONE":      0,
		"LINEAR":    1,
		"QUADRATIC": 2,
		"CUBIC":     3,
	}
)

Enum value maps for IndexMapping_Interpolation.

View Source
var File_ddsketch_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type DDSketch

type DDSketch struct {

	// The mapping between positive values and the bin indexes they belong to.
	Mapping *IndexMapping `protobuf:"bytes,1,opt,name=mapping,proto3" json:"mapping,omitempty"`
	// The store for keeping track of positive values.
	PositiveValues *Store `protobuf:"bytes,2,opt,name=positiveValues,proto3" json:"positiveValues,omitempty"`
	// The store for keeping track of negative values. A negative value v is mapped using its positive opposite -v.
	NegativeValues *Store `protobuf:"bytes,3,opt,name=negativeValues,proto3" json:"negativeValues,omitempty"`
	// The count for the value zero and its close neighborhood (whose width depends on the mapping).
	ZeroCount float64 `protobuf:"fixed64,4,opt,name=zeroCount,proto3" json:"zeroCount,omitempty"`
	// contains filtered or unexported fields
}

A DDSketch is essentially a histogram that partitions the range of positive values into an infinite number of indexed bins whose size grows exponentially. It keeps track of the number of values (or possibly floating-point weights) added to each bin. Negative values are partitioned like positive values, symmetrically to zero. The value zero as well as its close neighborhood that would be mapped to extreme bin indexes is mapped to a specific counter.

func (*DDSketch) Descriptor deprecated

func (*DDSketch) Descriptor() ([]byte, []int)

Deprecated: Use DDSketch.ProtoReflect.Descriptor instead.

func (*DDSketch) GetMapping

func (x *DDSketch) GetMapping() *IndexMapping

func (*DDSketch) GetNegativeValues

func (x *DDSketch) GetNegativeValues() *Store

func (*DDSketch) GetPositiveValues

func (x *DDSketch) GetPositiveValues() *Store

func (*DDSketch) GetZeroCount

func (x *DDSketch) GetZeroCount() float64

func (*DDSketch) ProtoMessage

func (*DDSketch) ProtoMessage()

func (*DDSketch) ProtoReflect

func (x *DDSketch) ProtoReflect() protoreflect.Message

func (*DDSketch) Reset

func (x *DDSketch) Reset()

func (*DDSketch) String

func (x *DDSketch) String() string

type IndexMapping

type IndexMapping struct {

	// The gamma parameter of the mapping, such that bin index that a value v belongs to is roughly equal to
	// log(v)/log(gamma).
	Gamma float64 `protobuf:"fixed64,1,opt,name=gamma,proto3" json:"gamma,omitempty"`
	// An offset that can be used to shift all bin indexes.
	IndexOffset float64 `protobuf:"fixed64,2,opt,name=indexOffset,proto3" json:"indexOffset,omitempty"`
	// To speed up the computation of the index a value belongs to, the computation of the log may be approximated using
	// the fact that the log to the base 2 of powers of 2 can be computed at a low cost from the binary representation of
	// the input value. Other values can be approximated by interpolating between successive powers of 2 (linearly,
	// quadratically or cubically).
	// NONE means that the log is to be computed exactly (no interpolation).
	Interpolation IndexMapping_Interpolation `protobuf:"varint,3,opt,name=interpolation,proto3,enum=IndexMapping_Interpolation" json:"interpolation,omitempty"`
	// contains filtered or unexported fields
}

How to map positive values to the bins they belong to.

func (*IndexMapping) Descriptor deprecated

func (*IndexMapping) Descriptor() ([]byte, []int)

Deprecated: Use IndexMapping.ProtoReflect.Descriptor instead.

func (*IndexMapping) GetGamma

func (x *IndexMapping) GetGamma() float64

func (*IndexMapping) GetIndexOffset

func (x *IndexMapping) GetIndexOffset() float64

func (*IndexMapping) GetInterpolation

func (x *IndexMapping) GetInterpolation() IndexMapping_Interpolation

func (*IndexMapping) ProtoMessage

func (*IndexMapping) ProtoMessage()

func (*IndexMapping) ProtoReflect

func (x *IndexMapping) ProtoReflect() protoreflect.Message

func (*IndexMapping) Reset

func (x *IndexMapping) Reset()

func (*IndexMapping) String

func (x *IndexMapping) String() string

type IndexMapping_Interpolation

type IndexMapping_Interpolation int32
const (
	IndexMapping_NONE      IndexMapping_Interpolation = 0
	IndexMapping_LINEAR    IndexMapping_Interpolation = 1
	IndexMapping_QUADRATIC IndexMapping_Interpolation = 2
	IndexMapping_CUBIC     IndexMapping_Interpolation = 3
)

func (IndexMapping_Interpolation) Descriptor

func (IndexMapping_Interpolation) Enum

func (IndexMapping_Interpolation) EnumDescriptor deprecated

func (IndexMapping_Interpolation) EnumDescriptor() ([]byte, []int)

Deprecated: Use IndexMapping_Interpolation.Descriptor instead.

func (IndexMapping_Interpolation) Number

func (IndexMapping_Interpolation) String

func (IndexMapping_Interpolation) Type

type Store

type Store struct {

	// The bin counts, encoded sparsely.
	BinCounts map[int32]float64 `` /* 164-byte string literal not displayed */
	// The bin counts, encoded contiguously. The values of contiguousBinCounts are the counts for the bins of indexes
	// o, o+1, o+2, etc., where o is contiguousBinIndexOffset.
	ContiguousBinCounts      []float64 `protobuf:"fixed64,2,rep,packed,name=contiguousBinCounts,proto3" json:"contiguousBinCounts,omitempty"`
	ContiguousBinIndexOffset int32     `protobuf:"zigzag32,3,opt,name=contiguousBinIndexOffset,proto3" json:"contiguousBinIndexOffset,omitempty"`
	// contains filtered or unexported fields
}

A Store maps bin indexes to their respective counts. Counts can be encoded sparsely using binCounts, but also in a contiguous way using contiguousBinCounts and contiguousBinIndexOffset. Given that non-empty bins are in practice usually contiguous or close to one another, the latter contiguous encoding method is usually more efficient than the sparse one. Both encoding methods can be used conjointly. If a bin appears in both the sparse and the contiguous encodings, its count value is the sum of the counts in each encodings.

func (*Store) Descriptor deprecated

func (*Store) Descriptor() ([]byte, []int)

Deprecated: Use Store.ProtoReflect.Descriptor instead.

func (*Store) GetBinCounts

func (x *Store) GetBinCounts() map[int32]float64

func (*Store) GetContiguousBinCounts

func (x *Store) GetContiguousBinCounts() []float64

func (*Store) GetContiguousBinIndexOffset

func (x *Store) GetContiguousBinIndexOffset() int32

func (*Store) ProtoMessage

func (*Store) ProtoMessage()

func (*Store) ProtoReflect

func (x *Store) ProtoReflect() protoreflect.Message

func (*Store) Reset

func (x *Store) Reset()

func (*Store) String

func (x *Store) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL