26 Commits

Author SHA1 Message Date
Viktor Szépe
2bd40d8c39 Remove trailing spaces (#665)
* Remove trailing spaces

* PR-665 -  Remove trailing spaces

- Updated not stable test t/pt-online-schema-change/preserve_triggers.t
- Updated utilities in bin directory

* PR-665 -  Remove trailing spaces

- Fixed typos

* PR-665 -  Remove trailing spaces

- Fixed typos

---------

Co-authored-by: Sveta Smirnova <sveta.smirnova@percona.com>
2023-09-06 01:15:12 +03:00
Daniel Nichter
feab2f0925 s/Percona Inc/Percona Ireland Ltd/g 2013-01-02 17:19:16 -07:00
Brian Fraser
b0f7bc4fc6 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.
2012-02-01 19:12:03 -03:00
Brian Fraser
7c4c186978 Change how Diskstats waits for its first handful of samples.
This fixes two bugs -- One a rounding error, one a desyncronization
between the main program and the data gathering daemon.

Additionally, it changes how the daemon prints the very first
sample. Before it would unconditionally wait until the time was
%$sample-time, which meant that in a worst case scenario,
a user could be left waiting for a while before seeing a line
of output.
This commit changes that first wait to only sleep if less
than 20% away from %$sample-time.
2012-02-01 12:14:09 -03:00
Brian Fraser
3de8aa530b More fixes as per Baron's review. 2012-01-31 22:44:00 -03:00
Brian Fraser
73c1e466d7 Several fixes & changes:
* qtime and stime computed correctly
* Interactive mode and changing groups doesn't fail
* Interactive mode no longer uses a file to gather samples.
2012-01-30 17:44:18 -03:00
Brian Fraser
ad552756b2 Automatic headers & improvements. 2012-01-18 19:01:19 -03:00
Brian Fraser
5b43ed0d5e More changes as per Baron's review.
Tries to implement a facsimile to http://www.xaprb.com/blog/2011/03/18/how-to-gather-statistics-at-regular-intervals/
For both sampling and rendering.
2012-01-18 05:19:48 -03:00
Brian Fraser
05fec15473 Fixes as per Baron's review. 2012-01-17 11:40:01 -03:00
Brian Fraser
d01d838b64 Several changes as per Baron & Daniel's mails.
Most importantly, it replaces --zero-rows with --show-inactive, and
changes the default logic used to decide when to print a device.
2012-01-16 09:37:53 -03:00
Daniel Nichter
9404ff84ef Rewrite pt-diskstats.t but all tests need to be fixed. Update modules in pt-diskstats, use PTDEBUG, check regex opts. Remove output_fh from Diskstats. Fix DiskstatsMenu header so update-modules can see it. 2012-01-12 12:06:50 -07:00
Brian Fraser
3165b3c0f8 Slew of changes from Daniel's review. 2012-01-12 10:37:49 -03:00
Brian Fraser
6d47e958c7 Change ->filter_zeroed_rows into ->zero_rows. 2012-01-10 16:28:32 -03:00
Brian Fraser
f173069109 Stop using /(?=)/ since /.+/ is good enough.
Originally, DiskstatsMenu differentiated between an empty pattern
entered by the user (which in the shell version meant "match all")
and any other valid pattern by replacing it with /(?=)/.

However, Diskstats now carries the original string, inside the
OptionParser object, so the above was redundant.
2012-01-10 16:10:50 -03:00
Brian Fraser
5ad1bc4fbb Explicit setter for device_regex and column_regex. 2012-01-10 14:14:32 -03:00
Brian Fraser
ae76c73395 Explicit setter for interactive. 2012-01-10 14:01:11 -03:00
Brian Fraser
79bdf3f1d3 Explicit setter for sample_time 2012-01-10 13:52:43 -03:00
Brian Fraser
187d921069 Explicit setter for filter_zeroed_rows 2012-01-10 13:46:05 -03:00
Brian Fraser
01042d0fda Use waitpid($pid, WNOHANG) instead of kill(0, $pid). 2012-01-10 11:25:18 -03:00
Brian Fraser
b4289010b1 Several fixes. --save-samples and --help should work now. 2012-01-10 10:47:50 -03:00
Brian Fraser
d3ef9edaaa Several corrections as per Daniel and Baron's feedback.
Still TODO: Attributes still have a single method that doubles
as a getter and setter. The constructor for Diskstats is still
weird -- A tad more stricter than it should be, if anything.
->print_rest is still rest, even though that's hardly
memorable, mostly because of a lack of ideas on what to
rename it. The main loop in the Menu is still a while (1).

As a nice perk, it's nearly twice as fast now! It also adds a
_very_ experimental --memory-for-speed argument, which
turns on memoization for the current biggest bottleneck.
2011-12-22 19:24:56 -03:00
Brian Fraser
467254aca3 Fixes to the Menu; additionally, changed the accepted format for samples.
Also made it hide rows that are all zeroes by default, as per the
blueprint.
2011-12-20 12:53:35 -03:00
Brian Fraser
13c9c5b0bb Added the actual pt-diskstats tool.
Missing a doc overhaul and tests, but this deals with most of the
feature upgrades in the blueprint.

The shell version of pt-diskstats is now in bin has pt-diskstats-shell,
in case that's needed.
2011-12-16 13:40:22 -03:00
Brian Fraser
7b12dbec64 Work in progress v3: Working interactive mode, initial documentation.
With this most of the interactive mode should be working.

pt_diskstats.pm has the documentation and can be used for testing,
which should be in the next commit.

This commit also includes the revamped command line options.
2011-12-15 20:26:55 -03:00
Brian Fraser
0fd09e8f6e Work in progress v2: Redesign pt-diskstats in Perl. 2011-12-13 14:53:05 -03:00
Brian Fraser
43b29d6374 Work in progress: Redesign pt-diskstats in Perl.
Mostly bits and pieces at the moments. ReadKeyMini is a portable-ish
Term::ReadKey. Used here by DiskstatsMenu, which is currently only
for show.

Diskstats has most of the logic of the old pt-diskstats, with parts
now implemented by the DiskstatsGroupBy* classes; The latter subclass
the former.

As mentioned at the start, this is a work in progress. In addition to to
not having all the parts attached, also missing are the data-gathering mode,
the command-line argument parsing, and a large amount of tests.
2011-12-08 19:26:04 -03:00