File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -29,37 +29,37 @@ type TDigestInfo struct {
2929 totalCompressions int64
3030}
3131
32- // Compression
32+ // Compression - returns the compression of TDigestInfo instance
3333func (info * TDigestInfo ) Compression () int64 {
3434 return info .compression
3535}
3636
37- // Capacity
37+ // Capacity - returns the capacity of TDigestInfo instance
3838func (info * TDigestInfo ) Capacity () int64 {
3939 return info .capacity
4040}
4141
42- // MergedNodes
42+ // MergedNodes - returns the merged nodes of TDigestInfo instance
4343func (info * TDigestInfo ) MergedNodes () int64 {
4444 return info .mergedNodes
4545}
4646
47- // UnmergedNodes
47+ // UnmergedNodes - returns the unmerged nodes of TDigestInfo instance
4848func (info * TDigestInfo ) UnmergedNodes () int64 {
4949 return info .unmergedNodes
5050}
5151
52- // MergedWeight
52+ // MergedWeight - returns the merged weight of TDigestInfo instance
5353func (info * TDigestInfo ) MergedWeight () float64 {
5454 return info .mergedWeight
5555}
5656
57- // UnmergedWeight
57+ // UnmergedWeight - returns the unmerged weight of TDigestInfo instance
5858func (info * TDigestInfo ) UnmergedWeight () float64 {
5959 return info .unmergedWeight
6060}
6161
62- // TotalCompressions
62+ // TotalCompressions - returns the total compressions of TDigestInfo instance
6363func (info * TDigestInfo ) TotalCompressions () int64 {
6464 return info .totalCompressions
6565}
Original file line number Diff line number Diff line change @@ -552,6 +552,9 @@ func TestClient_TdReset(t *testing.T) {
552552 info , err := client .TdInfo (key )
553553 assert .Nil (t , err )
554554 assert .Equal (t , 0.0 , info .UnmergedWeight ())
555+ assert .Equal (t , int64 (0 ), info .TotalCompressions ())
556+ assert .Equal (t , int64 (100 ), info .Compression ())
557+ assert .Equal (t , int64 (610 ), info .Capacity ())
555558}
556559
557560func TestClient_TdMerge (t * testing.T ) {
@@ -583,6 +586,8 @@ func TestClient_TdMerge(t *testing.T) {
583586 info , err := client .TdInfo (key1 )
584587 assert .Nil (t , err )
585588 assert .Equal (t , 10.0 , info .UnmergedWeight ()+ info .MergedWeight ())
589+ assert .Equal (t , int64 (2 ), info .UnmergedNodes ())
590+ assert .Equal (t , int64 (2 ), info .MergedNodes ())
586591}
587592
588593func TestClient_TdMinMax (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments