private void logGraphicalLoadAverage(double loadAvg,int availCpus){
  double loadAverage=loadAvg;
  if (loadAverage < 0) {
    loadAverage=0;
  }
  double value=(double)WIDTH / availCpus;
  long load=Math.round(loadAverage * value);
  if (load > WIDTH) {
    load=WIDTH;
  }
  String title="CPU load";
  StringBuilder sb=new StringBuilder();
  sb.append(START_END_CHAR);
  sb.append('-');
  sb.append(title);
  for (int i=title.length() + 1; i < WIDTH; i++) {
    sb.append('-');
  }
  sb.append(START_END_CHAR);
  log.info(sb.toString());
  sb=new StringBuilder();
  sb.append(START_END_CHAR);
  for (int i=0; i < load; i++) {
    sb.append('/');
  }
  for (long i=load; i < WIDTH; i++) {
    sb.append(' ');
  }
  sb.append(START_END_CHAR);
  log.info(sb.toString());
  sb=new StringBuilder();
  sb.append(START_END_CHAR);
  for (int i=0; i < WIDTH; i++) {
    sb.append('-');
  }
  sb.append(START_END_CHAR);
  log.info(sb.toString());
}

private void logGraphicalLoadAverage ( double loadAvg , int availCpus ) { double loadAverage = loadAvg ; if ( loadAverage < 0 ) { loadAverage = 0 ; } double value = ( double ) WIDTH / availCpus ; long load = Math . round ( loadAverage * value ) ; if ( load > WIDTH ) { load = WIDTH ; } String title = "CPU load" ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( START_END_CHAR ) ; sb . append ( '-' ) ; sb . append ( title ) ; for ( int i = title . length ( ) + 1 ; i < WIDTH ; i ++ ) { sb . append ( '-' ) ; } sb . append ( START_END_CHAR ) ; log . info ( sb . toString ( ) ) ; sb = new StringBuilder ( ) ; sb . append ( START_END_CHAR ) ; for ( int i = 0 ; i < load ; i ++ ) { sb . append ( '/' ) ; } for ( long i = load ; i < WIDTH ; i ++ ) { sb . append ( ' ' ) ; } sb . append ( START_END_CHAR ) ; log . info ( sb . toString ( ) ) ; sb = new StringBuilder ( ) ; sb . append ( START_END_CHAR ) ; for ( int i = 0 ; i < WIDTH ; i ++ ) { sb . append ( '-' ) ; } sb . append ( START_END_CHAR ) ; log . info ( sb . toString ( ) ) ; }
log a graphical version of the load average .
