Brian Fraser
2f3f75965a
Fixed a 'Use of uninitialized value' error in Diskstats->print_deltas()
...
It's not clear to me how this can even happen, as the variable is
package-scoped and set during compilation, but this should fix it.
2012-02-02 11:14:20 -03: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
Daniel Nichter
cd91b583c1
Removed unused global vars.
2012-02-01 10:03:37 -07: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
1fb316b63e
Merge lp:~percona-toolkit-dev/percona-toolkit/fix-897758
2012-01-31 16:16:27 -03:00
Daniel Nichter
df73364e97
Use VALUES instead of VALUE. Update TableChunker in all tools.
2012-01-31 11:07:08 -07:00
Daniel Nichter
6205505263
Don't use basename and quote $dir in tmpdir.sh.
2012-01-31 10:20:37 -07:00
Daniel Nichter
1a619cc47c
Test and fix typo in MasterSlave.pm and update that module in all tools.
2012-01-31 09:53:06 -07:00
Brian Fraser
807dbcfe21
Fix for #897758
2012-01-31 13:15:15 -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
Daniel Nichter
be8c0e6e18
Fix parsing opts from config file with leading and trailing space.
2012-01-30 11:15:28 -07:00
Daniel Nichter
89242d9fde
Don't init a global with a global.
2012-01-30 10:20:31 -07:00
Daniel Nichter
8389da4c07
Use . instead of source. Quote func file. Verify --function. Add option_error() to parse_options.sh. Update libs in pt-stalk.
2012-01-30 09:22:25 -07:00
Daniel Nichter
d1a684b55b
Use _pidof() and _lsof() from Percona Monitoring Plugins. Use "" and "yes" exclusively in collect(). Don't exec cmds that need mysqld_pid unless mysqld_pid is defined. Use log() instead of echo.
2012-01-30 08:59:19 -07:00
Daniel Nichter
e954505dd2
Don't print errors in data files; let the general -output file catch them. Print TS lines before data. Try to find sysctl manually. Add _pidof() to alt_cmds.sh.
2012-01-27 17:37:59 -07:00
Daniel Nichter
81ae556f8b
Use local IFS.
2012-01-26 13:04:23 -07:00
Daniel Nichter
6b017da6fe
Use new pretty --help.
2012-01-26 12:59:48 -07:00
Daniel Nichter
05ac0be136
Change --disk-byte-limit to --disk-bytes-free and --disk-pct-limit to --disk-pct-free.
2012-01-26 12:45:44 -07:00
Daniel Nichter
d7d5381863
Make check_disk_space() use bytes (given new size type options with are converted to bytes, 1k=>1024).
2012-01-26 12:19:47 -07:00
Daniel Nichter
81caf6addc
Convert size \d+[KMGT] opts in parse_options.sh.
2012-01-26 10:44:55 -07:00
Daniel Nichter
c2fd3f54c2
Use "yes" for true, "" for false. Use $PO_DIR instead of $TMP_DIR/po. Add and test Baron's code for 'Options and values after processing arguments'. Make --help exit 0 unless there were errors.
2012-01-24 12:49:18 -07:00
Daniel Nichter
42a8e39635
Use better Bash.
2012-01-24 12:28:41 -07:00
Daniel Nichter
36c14f492a
Don't use grep -q.
2012-01-24 12:15:29 -07:00
Daniel Nichter
4905e3503c
Handle --config FILE[,FILE,...] in parse_options.sh.
2012-01-24 11:18:41 -07:00
Daniel Nichter
034f76d77e
Fix handling EXT_ARGV.
2012-01-23 10:53:41 -07:00
Daniel Nichter
0d348ce289
Make parse_options work with everything: cmd line, config files, values with spaces, op val, op=val, etc.
2012-01-23 10:30:42 -07:00
Daniel Nichter
65a3ab5157
Handle values with spaces. Still needs work; one test is failing.
2012-01-21 13:59:02 -07:00
Daniel Nichter
acbc6b4622
Parse config files. Refactor parse_option.sh. Print --help and --version to STDOUT.
2012-01-20 11:34:51 -07:00
Daniel Nichter
88304e69fb
Replace MKDEBUG with PTDEBUG in modules.
2012-01-19 12:46:56 -07:00
Daniel Nichter
51b93a6235
Fix --help description interpolation.
2012-01-19 12:20:33 -07:00
Daniel Nichter
2412e01aa0
Use which to get programs. Don't create file unless the program or file exists.
2012-01-19 10:46:48 -07: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
Daniel Nichter
6e2b670af6
Die if --log, --pid, or --dest aren't accessible. Also die if po dir isn't accessible.
2012-01-17 13:12:08 -07:00
Daniel Nichter
b2bac5c765
Quote in tmpdir.sh and fix typo in doc.
2012-01-17 12:15:49 -07: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
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
cfce6e6eb2
More quoting and tweaking re Baron's review.
2012-01-13 10:02:17 -07: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
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
Daniel Nichter
a9afea4506
Quote vals in Bash libs. Add tests for log_warn_die.sh and alt_cmds.sh. Make --help test path independent.
2012-01-11 11:31:41 -07: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