2013-04-25 27 views
5

科達海爾的「度量標準」收到的一個屬性是「有偏差的」。
有人可以解釋它是什麼意思?「度量」直方圖中的「有偏差」意味着什麼

public Histogram newHistogram(Class<?> klass, 
        String name, 
        boolean biased) 
Creates a new Histogram and registers it under the given class and name. 
Parameters: 
klass - the class which owns the metric 
name - the name of the metric 
biased - whether or not the histogram should be biased 
Returns: 
a new Histogram 

回答

6

有疑問時,看看源:

/** 
    * Uses an exponentially decaying sample of 1028 elements, which offers a 99.9% confidence 
    * level with a 5% margin of error assuming a normal distribution, and an alpha factor of 
    * 0.015, which heavily biases the sample to the past 5 minutes of measurements. 
    */ 
    BIASED { 
     @Override 
     public Sample newSample() { 
      return new ExponentiallyDecayingSample(DEFAULT_SAMPLE_SIZE, DEFAULT_ALPHA); 
     } 
    }; 

一種有偏直方圖是一個給出更大的權重更近的測量。