From 72398e1ce606bfc8121a026abf9e06f71e511570 Mon Sep 17 00:00:00 2001 From: Steve Malenfant Date: Mon, 14 Aug 2017 13:17:39 -0400 Subject: [PATCH] Formatting float as integer - Convertion was auto-applied by MySQL, but not with Postgresql resulting in errors in logs --- traffic_ops/app/bin/checks/ToCDUCheck.pl | 2 +- traffic_ops/app/bin/checks/ToCHRCheck.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/traffic_ops/app/bin/checks/ToCDUCheck.pl b/traffic_ops/app/bin/checks/ToCDUCheck.pl index 95b6aa58ee..a7c935164c 100755 --- a/traffic_ops/app/bin/checks/ToCDUCheck.pl +++ b/traffic_ops/app/bin/checks/ToCDUCheck.pl @@ -104,7 +104,7 @@ ERROR "$host_name: cache size is 0!"; next; } - my $percentage_cache_used = sprintf( "%3.2f", ( $used / $size ) * 100 ); + my $percentage_cache_used = sprintf( "%3d", ( $used / $size ) * 100 ); TRACE "$host_name: percentage cache used == " . $percentage_cache_used; $ext->post_result( $server->{id}, $check_name, $percentage_cache_used ); } diff --git a/traffic_ops/app/bin/checks/ToCHRCheck.pl b/traffic_ops/app/bin/checks/ToCHRCheck.pl index 10bf0e65b3..3f1add7150 100755 --- a/traffic_ops/app/bin/checks/ToCHRCheck.pl +++ b/traffic_ops/app/bin/checks/ToCHRCheck.pl @@ -149,7 +149,7 @@ my $h = $hits - $prev_hits; my $m = $miss - $prev_miss; my $e = $errors - $prev_errors; - my $hr = sprintf( "%3.2f", $h / ( $h + $m + $e ) * 100 ); + my $hr = sprintf( "%3d", $h / ( $h + $m + $e ) * 100 ); TRACE "$host_name: \% hitratio: $hr\% errors: $e period: $secs\n"; $ext->post_result( $server->{id}, $check_name, $hr ); }