munin: Add polyline compression ratio

This commit is contained in:
Daniel Friesel 2020-02-10 20:06:55 +01:00
parent 3ddd1a1cf4
commit 7564ec34db

View file

@ -11,7 +11,7 @@ sub query_to_munin {
my ( $label, $value ) = @_; my ( $label, $value ) = @_;
if ( defined $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', query_to_munin( 'polylines',
$db->select( 'polylines', 'count(*) as count' )->hash->{count} ); $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; 1;