@@ -443,22 +443,22 @@ func (client *Client) CfInfo(key string) (map[string]int64, error) {
443443 return ParseInfoReply (redis .Values (conn .Do ("CF.INFO" , key )))
444444}
445445
446- // Allocate the memory and initialize the t-digest
447- func (client * Client ) TdCreate (key string , compression int64 ) (string , error ){
446+ // TdCreate - Allocate the memory and initialize the t-digest
447+ func (client * Client ) TdCreate (key string , compression int64 ) (string , error ) {
448448 conn := client .Pool .Get ()
449449 defer conn .Close ()
450450 return redis .String (conn .Do ("TDIGEST.CREATE" , key , compression ))
451451}
452452
453- // Reset the sketch to zero - empty out the sketch and re-initialize it
454- func (client * Client ) TdReset (key string ) (string , error ){
453+ // TdReset - Reset the sketch to zero - empty out the sketch and re-initialize it
454+ func (client * Client ) TdReset (key string ) (string , error ) {
455455 conn := client .Pool .Get ()
456456 defer conn .Close ()
457457 return redis .String (conn .Do ("TDIGEST.RESET" , key ))
458458}
459459
460- // Adds one or more samples to a sketch
461- func (client * Client ) TdAdd (key string , samples map [string ]float64 ) ([]string , error ) ) {
460+ // TdAdd - Adds one or more samples to a sketch
461+ func (client * Client ) TdAdd (key string , samples map [string ]float64 ) ([]string , error ) {
462462 conn := client .Pool .Get ()
463463 defer conn .Close ()
464464 args := redis.Args {key }
@@ -469,43 +469,43 @@ func (client *Client) TdAdd(key string, samples map[string]float64) ([]string, e
469469 return redis .Strings (reply , err )
470470}
471471
472- // Merges all of the values from 'from' to 'this' sketch
472+ // TdMerge - Merges all of the values from 'from' to 'this' sketch
473473func (client * Client ) TdMerge (toKey string , fromKey string ) (string , error ) {
474474 conn := client .Pool .Get ()
475475 defer conn .Close ()
476476 return redis .String (conn .Do ("TDIGEST.MERGE" , toKey , fromKey ))
477477}
478478
479- // Get minimum value from the sketch. Will return DBL_MAX if the sketch is empty
479+ // TdMin - Get minimum value from the sketch. Will return DBL_MAX if the sketch is empty
480480func (client * Client ) TdMin (key string ) (float64 , error ) {
481481 conn := client .Pool .Get ()
482482 defer conn .Close ()
483- return redis .String (conn .Do ("TDIGEST.MIN" , key ))
483+ return redis .Float64 (conn .Do ("TDIGEST.MIN" , key ))
484484}
485485
486- // Get maximum value from the sketch. Will return DBL_MIN if the sketch is empty
486+ // TdMax - Get maximum value from the sketch. Will return DBL_MIN if the sketch is empty
487487func (client * Client ) TdMax (key string ) (float64 , error ) {
488488 conn := client .Pool .Get ()
489489 defer conn .Close ()
490- return redis .String (conn .Do ("TDIGEST.MAX" , key ))
490+ return redis .Float64 (conn .Do ("TDIGEST.MAX" , key ))
491491}
492492
493- // Returns an estimate of the cutoff such that a specified fraction of the data added
493+ // TdQuantile - Returns an estimate of the cutoff such that a specified fraction of the data added
494494// to this TDigest would be less than or equal to the cutoff
495495func (client * Client ) TdQuantile (key string , quantile float64 ) (float64 , error ) {
496496 conn := client .Pool .Get ()
497497 defer conn .Close ()
498- return redis .String (conn .Do ("TDIGEST.QUANTILE" , key , quantile ))
498+ return redis .Float64 (conn .Do ("TDIGEST.QUANTILE" , key , quantile ))
499499}
500500
501- // Returns the fraction of all points added which are <= value
501+ // TdCdf - Returns the fraction of all points added which are <= value
502502func (client * Client ) TdCdf (key string , value float64 ) (float64 , error ) {
503503 conn := client .Pool .Get ()
504504 defer conn .Close ()
505- return redis .String (conn .Do ("TDIGEST.CDF" , key , value ))
505+ return redis .Float64 (conn .Do ("TDIGEST.CDF" , key , value ))
506506}
507507
508- // Returns compression, capacity, total merged and unmerged nodes, the total
508+ // TdInfo - Returns compression, capacity, total merged and unmerged nodes, the total
509509// compressions made up to date on that key, and merged and unmerged weight.
510510func (client * Client ) TdInfo (key string ) (map [string ]int64 , error ) {
511511 conn := client .Pool .Get ()
0 commit comments