HADOOP-11447. Add a more meaningful toString method to SampleStat and MutableStat. (kasha)
(cherry picked from commit fe5c23b670
)
This commit is contained in:
parent
a3a155a34e
commit
3672ae8a7a
|
@ -23,6 +23,9 @@ Release 2.8.0 - UNRELEASED
|
||||||
HADOOP-11709. Time.NANOSECONDS_PER_MILLISECOND - use class-level final
|
HADOOP-11709. Time.NANOSECONDS_PER_MILLISECOND - use class-level final
|
||||||
constant instead of method variable (Ajith S via ozawa)
|
constant instead of method variable (Ajith S via ozawa)
|
||||||
|
|
||||||
|
HADOOP-11447. Add a more meaningful toString method to SampleStat and
|
||||||
|
MutableStat. (kasha)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
|
@ -150,4 +150,8 @@ public class MutableStat extends MutableMetric {
|
||||||
minMax.reset();
|
minMax.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return lastStat().toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,6 +137,19 @@ public class SampleStat {
|
||||||
return minmax.max();
|
return minmax.max();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
try {
|
||||||
|
return "Samples = " + numSamples() +
|
||||||
|
" Min = " + min() +
|
||||||
|
" Mean = " + mean() +
|
||||||
|
" Std Dev = " + stddev() +
|
||||||
|
" Max = " + max();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
return super.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper to keep running min/max
|
* Helper to keep running min/max
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue