HdrHistogram / hdrhistogram-go

A pure Go implementation of Gil Tene's HDR Histogram.
MIT License
439 stars 64 forks source link

recording value 11 out of range 0-200 #2

Closed kr closed 10 years ago

kr commented 10 years ago

I was perplexed that this

package main

import (
    "fmt"

    "github.com/codahale/hdrhistogram"
)

func main() {
    h := hdrhistogram.New(0, 200, 4)
    err := h.RecordValue(11)
    fmt.Println(err)
}

produced this

$ go run y.go 
value 11 is too large to be recorded

Then I checked the unit tests, and they all use 1 as the min. Is 1 the minimum minimum? I'm happy to send a documentation patch if you think this should be explicitly warned about.

codahale commented 10 years ago

No, was just an underflow on the unit magnitude. Good find, thanks.