summaryrefslogtreecommitdiff
path: root/index.pl
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-03-03 18:30:07 +0100
committerDaniel Friesel <derf@finalrewind.org>2015-03-03 18:30:07 +0100
commitdbba459cee5a27d4aaf32c2e989c3604913000be (patch)
tree1c2bc97bf688cdce0e67ccd5bd71204e1e4f1904 /index.pl
parent9392bec63bd1057f263dacdd985b628f40fd04bf (diff)
barplot: Handle NULL values in delay/is_canceled in count
Diffstat (limited to 'index.pl')
-rw-r--r--index.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/index.pl b/index.pl
index c29c314..51b524c 100644
--- a/index.pl
+++ b/index.pl
@@ -215,7 +215,7 @@ get '/2ddata.tsv' => sub {
given ($metric) {
when ('avg_delay') {
$query = qq{
- select $format as aggregate, avg(delay), count()
+ select $format as aggregate, avg(delay), count(delay)
from $table where not is_canceled and $where_clause group by aggregate
};
}
@@ -227,21 +227,21 @@ get '/2ddata.tsv' => sub {
}
when ('cancel_rate') {
$query = qq{
- select $format as aggregate, avg(is_canceled), count(),
+ select $format as aggregate, avg(is_canceled), count(is_canceled),
sum(is_canceled = 1)
from $table where $where_clause group by aggregate
};
}
when ('delay0_rate') {
$query = qq{
- select $format as aggregate, avg(delay < 1), count(),
+ select $format as aggregate, avg(delay < 1), count(delay),
sum(delay < 1)
from $table where $where_clause group by aggregate
};
}
when ('delay5_rate') {
$query = qq{
- select $format as aggregate, avg(delay > 5), count(),
+ select $format as aggregate, avg(delay > 5), count(delay),
sum(delay > 5)
from $table where $where_clause group by aggregate
};