diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-02-10 20:06:55 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-02-10 20:06:55 +0100 |
commit | 7564ec34db313bd41459defcdccf43fa03a8fe32 (patch) | |
tree | 22627b10999d2cd2dca4a11313fe56057faa6bef | |
parent | 3ddd1a1cf47feb7c037db60555b4287e5a684a08 (diff) |
munin: Add polyline compression ratio1.14.8
-rw-r--r-- | lib/Travelynx/Command/munin.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Travelynx/Command/munin.pm b/lib/Travelynx/Command/munin.pm index aeb7bff..01f5a0e 100644 --- a/lib/Travelynx/Command/munin.pm +++ b/lib/Travelynx/Command/munin.pm @@ -11,7 +11,7 @@ sub query_to_munin { my ( $label, $value ) = @_; if ( defined $value ) { - printf( "%s.value %d\n", $label, $value ); + printf( "%s.value %f\n", $label, $value ); } } @@ -58,6 +58,12 @@ sub run { ); query_to_munin( 'polylines', $db->select( 'polylines', 'count(*) as count' )->hash->{count} ); + query_to_munin( + 'polyline_ratio', + $db->query( +'select (select count(polyline_id) from journeys)::float / (select count(*) from polylines) as ratio' + )->hash->{ratio} + ); } 1; |