// NewPCPHistogram returns a new instance of PCPHistogram.
// The lowest value for `low` is 0.
// The highest value for `high` is 3,600,000,000.
// `low` **must** be less than `high`.
// The value of `sigfigures` can be between 1 and 5.
// It also requires a unit to be explicitly passed for construction.
// Optionally, a couple of description strings may be passed as the short and
// long descriptions of the metric.
NewPCPHistogram returns a new instance of PCPHistogram.
The lowest value for `low` is 0.
// NewPCPHistogram returns a new instance of PCPHistogram . // The lowest value for ` low ` is 0 . // The highest value for ` high ` is 3 600 000 000 . // ` low ` ** must ** be less than ` high ` . // The value of ` sigfigures ` can be between 1 and 5 . // It also requires a unit to be explicitly passed for construction . // Optionally a couple of description strings may be passed as the short and // long descriptions of the metric .
func NewPCPHistogram(name string, low, high int64, sigfigures int, unit MetricUnit, desc ...string) (*PCPHistogram, error) {
	if low > high {
		return nil, errors.New("low cannot be larger than high")
	}
	low, high, sigfigures = normalize(low, high, sigfigures)
	h := histogram.New(low, high, sigfigures)
	vals := make(Instances)
	for _, s := range histogramInstances {
		vals[s] = float64(0)
	}
	d, err := newpcpMetricDesc(name, DoubleType, InstantSemantics, unit, desc...)
	if err != nil {
		return nil, err
	}
	m, err := newpcpInstanceMetric(vals, histogramIndom, d)
	if err != nil {
		return nil, err
	}
	return &PCPHistogram{m, sync.RWMutex{}, h}, nil
}
func NewPCPHistogram ( name string , low , high int64 , sigfigures int , unit MetricUnit , desc ... string ) ( * PCPHistogram , error ) { if low > high { return nil , errors . New ( " " ) } low , high , sigfigures = normalize ( low , high , sigfigures ) h := histogram . New ( low , high , sigfigures ) vals := make ( Instances ) for _ , s := range histogramInstances { vals [ s ] = float64 ( 0 ) } d , err := newpcpMetricDesc ( name , DoubleType , InstantSemantics , unit , desc ... ) if err != nil { return nil , err } m , err := newpcpInstanceMetric ( vals , histogramIndom , d ) if err != nil { return nil , err } return & PCPHistogram { m , sync . RWMutex { } , h } , nil }
NewPCPHistogram returns a new instance of PCPHistogram.
NewPCPHistogram returns a new instance of PCPHistogram .