Exemple #1
0
// NewEmptyProperties returns an empty property struct
func NewEmptyProperties() *pb.SketchProperties {
	return &pb.SketchProperties{
		ErrorRate:      utils.Float32p(0),
		MaxUniqueItems: utils.Int64p(0),
		Size:           utils.Int64p(0),
	}
}
Exemple #2
0
// Copy sketch
func (info *Info) Copy() *Info {
	typ := pb.SketchType(info.GetType())
	return &Info{
		Sketch: &pb.Sketch{
			Properties: &pb.SketchProperties{
				ErrorRate:      utils.Float32p(info.Properties.GetErrorRate()),
				MaxUniqueItems: utils.Int64p(info.Properties.GetMaxUniqueItems()),
				Size:           utils.Int64p(info.Properties.GetSize()),
			},
			State: &pb.SketchState{
				FillRate:     utils.Float32p(info.State.GetFillRate()),
				LastSnapshot: utils.Int64p(info.State.GetLastSnapshot()),
			},
			Name: utils.Stringp(info.GetName()),
			Type: &typ,
		},
	}
}
Exemple #3
0
// NewEmptyState returns an empty state struct
func NewEmptyState() *pb.SketchState {
	return &pb.SketchState{
		FillRate:     utils.Float32p(0),
		LastSnapshot: utils.Int64p(0),
	}
}