示例#1
0
文件: info.go 项目: silky/skizze
// 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),
	}
}
示例#2
0
文件: info.go 项目: silky/skizze
// 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,
		},
	}
}
示例#3
0
文件: info.go 项目: silky/skizze
// NewEmptyState returns an empty state struct
func NewEmptyState() *pb.SketchState {
	return &pb.SketchState{
		FillRate:     utils.Float32p(0),
		LastSnapshot: utils.Int64p(0),
	}
}