diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-03-03 18:30:07 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-03-03 18:30:07 +0100 |
commit | dbba459cee5a27d4aaf32c2e989c3604913000be (patch) | |
tree | 1c2bc97bf688cdce0e67ccd5bd71204e1e4f1904 /index.pl | |
parent | 9392bec63bd1057f263dacdd985b628f40fd04bf (diff) |
barplot: Handle NULL values in delay/is_canceled in count
Diffstat (limited to 'index.pl')
-rw-r--r-- | index.pl | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 }; |