nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
108b39a
)
metrics: allow Metric sorting
author
Alexandre Terrasa
<alexandre@moz-code.org>
Tue, 21 Apr 2015 20:26:29 +0000
(16:26 -0400)
committer
Alexandre Terrasa
<alexandre@moz-code.org>
Thu, 23 Apr 2015 19:13:52 +0000
(15:13 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
src/metrics/metrics_base.nit
patch
|
blob
|
history
diff --git
a/src/metrics/metrics_base.nit
b/src/metrics/metrics_base.nit
index
c51e656
..
7881e75
100644
(file)
--- a/
src/metrics/metrics_base.nit
+++ b/
src/metrics/metrics_base.nit
@@
-211,6
+211,11
@@
interface Metric
# The set of element above the threshold
fun above_threshold: Set[ELM] is abstract
+
+ # Sort the metric keys by values
+ fun sort: Array[ELM] do
+ return values.keys_sorted_by_values(default_reverse_comparator)
+ end
end
# A Metric that collects integer data
@@
-338,7
+343,6
@@
class FloatMetric
print "{"\t" * indent} sum: {sum}"
end
end
-
end
# A MetricSet is a metric holder