Commit Graph

195 Commits

Author SHA1 Message Date
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
3a66cf5187 Removed lib/pt_diskstats.pm, since it's no longer needed. 2012-01-17 11:41:15 -03:00
Brian Fraser
05fec15473 Fixes as per Baron's review. 2012-01-17 11:40:01 -03:00
Brian Fraser
076c0d70b1 (Whoops. Forgot to commit the changed tests) 2012-01-16 09:48:59 -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
87d12c9802 Don't warn about invalid lines, just debug them. Anchor TS pattern. Unset --sample-time unless --group-by sample. 2012-01-12 14:26:31 -07:00
Daniel Nichter
60e16254d3 Correction to r140: only the test marked in this diff needs to be fixed. 2012-01-12 12:09:01 -07: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
Daniel Nichter
8d70a272fe Simplify parse_diskstats_line() and _calc_delta_for(). Use UPPERCASE for constants. Don't save unused values in dev stats array. Use actual values from an OptionParser/pt-diskstats. 2012-01-12 10:09:40 -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
eaae370f81 Removed the handling of the partition format.
/proc/diskstats actually has two formats, one for devices, one for
partitions. The latter wasn't handled by the original pt-diskstats,
but one of the previous commits introducing some minimal handling
for that. This commit removes that, since the partition format
doesn't have enough information to be useful.
2012-01-10 14:28:24 -03:00
Brian Fraser
13210d1978 Explicit setter for filename. 2012-01-10 14:16:44 -03:00
Brian Fraser
5ad1bc4fbb Explicit setter for device_regex and column_regex. 2012-01-10 14:14:32 -03:00
Brian Fraser
93279a03da Explicit setter for out_fh. 2012-01-10 14:05:02 -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
25909caa4e Explicit setters for (curr|prev|first)_ts. 2012-01-10 13:40:51 -03:00
Brian Fraser
9fd8e8d61d Make a test clean up after itself. 2012-01-10 11:26:11 -03:00
Brian Fraser
01042d0fda Use waitpid($pid, WNOHANG) instead of kill(0, $pid). 2012-01-10 11:25:18 -03:00
Brian Fraser
5098d33372 Updated tool based on the previous commits. 2012-01-10 10:55:16 -03:00
Brian Fraser
038dfeba59 Useless local pointed out by Daniel. 2012-01-10 10:53:28 -03:00
Brian Fraser
b4289010b1 Several fixes. --save-samples and --help should work now. 2012-01-10 10:47:50 -03:00
Brian Fraser
93271379d8 Tool updated based on the previous commit. 2011-12-22 19:32:51 -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
8da8d1ff61 Diskstats.pm: Wrong math for millisecond to second.
Sorry about that. Mind bug on my side.
2011-12-16 13:55:31 -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
Daniel Nichter
bbfaa22615 Merge fix-bug-856065. 2011-11-14 09:28:05 -07:00
Daniel Nichter
26a42a24d5 Add back --quiet and test pt-trend. 2011-11-14 09:23:47 -07:00
Daniel Nichter
bf6f70049a Merge fix-bug-887688. 2011-11-09 08:17:39 -07:00
Daniel Nichter
2f9ab4081a Fix prepared report for statements without corresponding prep or exec. 2011-11-08 12:53:50 -07:00
Daniel Nichter
4f1fa405b7 Merge fix-bug-884504. 2011-11-04 11:32:44 -06:00
Daniel Nichter
1904542c4b Check that pt-collect exists before starting. 2011-11-04 11:29:26 -06:00
Daniel Nichter
b2d2cf38f1 Merge fix-bug-857091. 2011-11-04 10:53:15 -06:00
Daniel Nichter
ebe28781e2 Get tools from http://www.percona.com/get/ so curl works. 2011-11-04 10:44:10 -06:00
Daniel Nichter
8282d4d6e3 Merge fix-bug-857104. 2011-11-04 10:28:59 -06:00
Daniel Nichter
aa1b0802a2 Use $PR_mext instead of pt-mext. 2011-11-04 10:22:34 -06:00
Daniel Nichter
cd5611b8b3 Change mext to pt-mext. 2011-11-04 10:15:20 -06:00
Daniel Nichter
dfad96537e Merge fix-bug-821717. 2011-10-11 08:37:14 -06:00
Daniel Nichter
7da33234f5 Fix bug 821717: pt-tcp-model --type=requests crashes. 2011-10-11 08:31:42 -06:00
Daniel Nichter
ccd1a2a7f8 Merge Rodrigo's pt-docs-percona-theme. 2011-09-14 08:50:32 -06:00
Daniel Nichter
bbbdabbaa3 Merge nibble-iterator. 2011-09-14 08:31:08 -06:00
Rodrigo Gadea
5b348757c0 Fixed drop-down menues in layout and added tags to bug reporting 2011-09-13 02:20:22 -03:00
Daniel Nichter
792c3a6638 Use Data::Dumper so debug statement works. 2011-09-12 10:53:53 -06:00