~percona-toolkit-dev/percona-toolkit/pt-diskstats-2.0

« back to all changes in this revision

Viewing changes to lib/DiskstatsGroupBySample.pm

  • Committer: Brian Fraser
  • Date: 2012-02-01 22:12:03 UTC
  • Revision ID: brian.fraser@percona.com-20120201221203-q2feng8fah0cvonc
Tweaks requested by Baron, plus fixes.

Tweaks:
* --headers command line option, which can be used to
        enable/disable the automatic headers, and the
        automatic empty lines between samples.
* --show-timestamps, which changes the #ts line with
        a timestamp in the HH:MM:SS format.
* Always use ReadKeyMini, even when we have Term::ReadKey.
        In the latter case, use the Term::ReadKey functions,
        but if they fail, try again with our own versions.

Fix:
Looks like I forgot to actually enable the "save the current, first
and last" samples. This is now on. It should mean faster and better
output when changing --group-by modes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
   return \%stats;
204
204
}
205
205
 
 
206
sub compute_line_ts {
 
207
   my ($self, %args) = @_;
 
208
   if ( $self->show_timestamps() ) {
 
209
      @args{ qw( first_ts curr_ts ) } = @args{ qw( curr_ts first_ts ) }
 
210
   }
 
211
   return $self->SUPER::compute_line_ts(%args);
 
212
}
 
213
 
206
214
1;
207
215
 
208
216
}