TritonDataCenter / dragnet

event stream analysis
MIT License
11 stars 4 forks source link

aggr=quantize is broken on the number `0` #7

Closed mcavage closed 10 years ago

mcavage commented 10 years ago

dn appears to always move values of 0 into the bucket above:

Marks-MacBook-Pro:dragnet mcavage$ (seq 0 63 | while read i; do echo "{ \"x\": $i }"; done) | ./bin/dn scan-file -b x[aggr=quantize] /dev/stdin

           value  ------------- Distribution ------------- count
               0 |                                         0
               1 |@                                        2
               2 |@                                        2
               4 |@@@                                      4
               8 |@@@@@                                    8
              16 |@@@@@@@@@@                               16
              32 |@@@@@@@@@@@@@@@@@@@@                     32
              64 |                                         0
Marks-MacBook-Pro:dragnet mcavage$ (seq 0 63 | while read i; do echo "{ \"x\": $i }"; done) | ./bin/dn scan-file --points -b x[aggr=quantize] /dev/stdin
{"fields":{"x":0.5},"value":1}
{"fields":{"x":1},"value":1}
{"fields":{"x":2},"value":2}
{"fields":{"x":4},"value":4}
{"fields":{"x":8},"value":8}
{"fields":{"x":16},"value":16}
{"fields":{"x":32},"value":32}
davepacheco commented 10 years ago

Fixed with node-skinner#7.