diff --git a/common/load.cc b/common/load.cc index 6dc3fe7..b98bfc7 100644 --- a/common/load.cc +++ b/common/load.cc @@ -41,13 +41,13 @@ std::string load_string( bool use_colors = false ) if( getloadavg( averages, nelem ) < 0 ) { - ss << "0.00 0.00 0.00"; // couldn't get averages. + ss << " 0.00 0.00 0.00"; // couldn't get averages. } else { if( use_colors ) { - unsigned load_percent = static_cast( averages[0] / + unsigned load_percent = static_cast( averages[0] / get_cpu_count() * 0.5f * 100.0f ); if( load_percent > 100 ) @@ -57,6 +57,7 @@ std::string load_string( bool use_colors = false ) ss << load_lut[load_percent]; } + ss << ' '; for( int i = 0; i < nelem; ++i ) { // Round to nearest, make sure this is only a 0.00 value not a 0.0000 diff --git a/common/main.cc b/common/main.cc index f9c3264..edabdce 100644 --- a/common/main.cc +++ b/common/main.cc @@ -155,7 +155,7 @@ int main( int argc, char** argv ) } std::cout << mem_string( use_colors ) - << cpu_string( cpu_usage_delay, graph_lines, use_colors ) << ' ' + << cpu_string( cpu_usage_delay, graph_lines, use_colors ) << load_string( use_colors ); return EXIT_SUCCESS;