lib/dtrace-async.js
/*
 * Initialize the mapping between bucket index and the corresponding range of
 * values for a quantize() bucket.  Each range is an array denoting [min, max].
 * Values are always integers, and both endpoints are included.  As a result,
 * you get buckets like:
 *
 * RANGE     CONTAINED VALUES
 * [-7, -4]  -7, -6, -5, and -4
 * [-3, -2]  -2 and -3
 * [-1, -1]  -1
 * [ 0,  0]   0
 * [ 1,  1]   1
 * [ 2,  3]   2 and 3
 * [ 4,  7]   4, 5, 6, and 7
 */
Initialize the mapping between bucket index and the corresponding range of
values for a quantize() bucket.  Each range is an array denoting [min, max].
Values are always integers, and both endpoints are included.  As a result,
you get buckets like.


Initialize the mapping between bucket index and the corresponding range of values for a quantize () bucket . Each range is an array denoting [ min max ] . Values are always integers and both endpoints are included . As a result you get buckets like .
function makeQuantizeBuckets()
{
	var rv = new Array(dtc_conf.DTRACE_QUANTIZE_NBUCKETS);
	var i, min, max;
	for (i = 0; i < rv.length; i++) {
		if (i < dtc_conf.DTRACE_QUANTIZE_ZEROBUCKET) {
			min = i > 0 ? quantizeBucketval(i - 1) + 1 :
			    dtc_conf.INT64_MIN;
			max = quantizeBucketval(i);
		} else if (i == dtc_conf.DTRACE_QUANTIZE_ZEROBUCKET) {
			min = max = 0;
		} else {
			min = quantizeBucketval(i);
			max = i < dtc_conf.DTRACE_QUANTIZE_NBUCKETS - 1 ?
			    quantizeBucketval(i + 1) - 1 : dtc_conf.INT64_MAX;
		}
		rv[i] = [ min, max ];
	}
	return (rv);
}
function makeQuantizeBuckets ( ) { var rv = new Array ( dtc_conf . DTRACE_QUANTIZE_NBUCKETS ) ; var i , min , max ; for ( i = 0 ; i < rv . length ; i ++ ) { if ( i < dtc_conf . DTRACE_QUANTIZE_ZEROBUCKET ) { min = i > 0 ? quantizeBucketval ( i - 1 ) + 1 : dtc_conf . INT64_MIN ; max = quantizeBucketval ( i ) ; } else if ( i == dtc_conf . DTRACE_QUANTIZE_ZEROBUCKET ) { min = max = 0 ; } else { min = quantizeBucketval ( i ) ; max = i < dtc_conf . DTRACE_QUANTIZE_NBUCKETS - 1 ? quantizeBucketval ( i + 1 ) - 1 : dtc_conf . INT64_MAX ; } rv [ i ] = [ min , max ] ; } return ( rv ) ; }
Initialize the mapping between bucket index and the corresponding range of
 values for a quantize() bucket.
Initialize the mapping between bucket index and the corresponding range of values for a quantize () bucket .