Module: check_mk
Branch: master
Commit: 4ab1cc4e8101ad1da74f6b831b09f662d0293957
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4ab1cc4e8101ad…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Sep 8 09:45:55 2011 +0200
FIX: fix Stats: sum/min/max/avg for columns of type time
---
ChangeLog | 1 +
livestatus/src/Query.cc | 2 +-
livestatus/src/StatsColumn.cc | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a3e813c..9743b49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,7 @@
* FIX: tables comments and downtimes now honor AuthUser
* Table log honors AuthUser for entries that belong to hosts
(not for external commands, though. Sorry...)
+ * FIX: fix Stats: sum/min/max/avg for columns of type time
1.1.11i3:
Core, Setup, etc.:
diff --git a/livestatus/src/Query.cc b/livestatus/src/Query.cc
index 2519340..d1142d0 100644
--- a/livestatus/src/Query.cc
+++ b/livestatus/src/Query.cc
@@ -379,7 +379,7 @@ void Query::parseStatsLine(char *line)
operation = STATS_OP_STD;
char *column_name;
- if (operation == STATS_OP_COUNT)
+ if (operation == STATS_OP_COUNT)
column_name = col_or_op;
else {
// aggregation operator is followed by column name
diff --git a/livestatus/src/StatsColumn.cc b/livestatus/src/StatsColumn.cc
index c010577..bda53c4 100644
--- a/livestatus/src/StatsColumn.cc
+++ b/livestatus/src/StatsColumn.cc
@@ -42,7 +42,7 @@ Aggregator *StatsColumn::createAggregator()
{
if (_operation == STATS_OP_COUNT)
return new CountAggregator(_filter);
- else if (_column->type() == COLTYPE_INT)
+ else if (_column->type() == COLTYPE_INT || _column->type() == COLTYPE_TIME)
return new IntAggregator((IntColumn *)_column, _operation);
else if (_column->type() == COLTYPE_DOUBLE)
return new DoubleAggregator((DoubleColumn *)_column, _operation);