dataset: add more logging

This commit is contained in:
carla 2020-02-11 17:18:47 +02:00
parent 86e0795fc2
commit acde3549a8
No known key found for this signature in database
GPG key ID: 4CA7FE54A6213C91

View file

@ -180,7 +180,8 @@ func (d Dataset) GetOutliers(outlierMultiplier float64) (
// we cannot calculate outliers so we return a map with all false
// outlier results.
if err == errTooFewValues {
log.Info(err)
log.Debug("could not calculate quartiles: %v, returning an "+
"empty set of outliers", err)
// Return a map with no outliers.
for label := range d {
@ -195,6 +196,9 @@ func (d Dataset) GetOutliers(outlierMultiplier float64) (
return nil, err
}
log.Tracef("quartiles calculated for: %v items: upper quartile: %v, "+
"lower quartile: %v", len(d), upper, lower)
// If we could could calculate quartiles for the dataset, we get
// outliers and populate a result map.
for label, value := range d {
@ -212,6 +216,9 @@ func (d Dataset) GetOutliers(outlierMultiplier float64) (
func (d Dataset) GetThreshold(thresholdValue float64, below bool) map[string]bool {
threshold := make(map[string]bool, len(d.rawValues()))
log.Tracef("examining %v items with threshold: %v, looking "+
"for <= threshold: %v", len(d), thresholdValue, below)
for label, value := range d {
// If we are looking for values below the threshold, check the
// current value then move on to the next one.