Bug 1671818
| Summary: | pcp ignores --finish=time option | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Dwight (Bud) Brown <bubrown> | |
| Component: | pcp | Assignee: | Mark Goodwin <mgoodwin> | |
| Status: | CLOSED WONTFIX | QA Contact: | qe-baseos-tools-bugs | |
| Severity: | medium | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 6.10 | CC: | agerstmayr, mgoodwin, nathans, patrickm, toneata | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | pcp-4.3.3-1 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1711085 (view as bug list) | Environment: | ||
| Last Closed: | 2019-05-16 23:55:22 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
|
Description
Dwight (Bud) Brown
2019-02-01 18:31:04 UTC
As discussed, Mark; looks like it fails to stop at --finish time when run with -u option. The --start off-by-one issue is possibly related to rate conversion of counters, but that's just a guess - worth taking a closer look. Thanks! The problem only occurs in non-interpolated mode (-u flag) and only for apps that use pmcc.py (the convenience classes). So pcp-iostat (aka pmiostat) is affected, but pmrep is not. The bug is in MetricGroupManager._computeSamples(), which is called by MetricGroupManager.run() to compute the number of loop iterations before terminating, i.e. the end of the time window. The time window (and hence number of reporting loops) is computed from the start, finish and delta arguments, but in non-interpolated mode the delta is not defined (it's inherent to the underlying fetch intervals for log records in the archive). Therefore, run() doesn't know when to stop. To fix this, run() would need to check if the current sample time is past the designated finish time rather than just checking if we have looped for the computed number of samples. Work-arounds: (a) don't use -u and --finish together. The -u and -t flags are incompatible, and so are -u and --finish. (b) use --start and --samples instead of --start and --finish. (c) use interpolated mode, i.e. -t interval (for desired interval) instead of -u
Fixed upstream for pcp-4.3.3 (currently under development):
Mark Goodwin (2):
qa: add qa/1588 to test python pmcc time window handling
python: fix pmcc time window handling
qa/1588 | 55 +++
qa/1588.out | 775 +++++++++++++++++++++++++++++++++++++++++++++++++
qa/group | 1
src/python/pcp/pmcc.py | 57 ++-
4 files changed, 869 insertions(+), 19 deletions(-)
Details :
commit 7aa23e63e5c63ea6dd561bf3cfbb45a92539fa02 (HEAD -> master)
Author: Mark Goodwin <mgoodwin>
Date: Thu May 16 16:44:20 2019 +1000
python: fix pmcc time window handling
For reference, see BZ 1671818 - pcp ignores --finish=time option.
PCP python apps that use pmcc and support -u (non-interpolation mode)
ignore the --finish time window option because the calculation relies
on sampling time delta being set (but it is not set in -u mode).
With this fix to pmcc.py, the --samples and --finish options
are both considered when deciding when to terminate the run()
loop. If both --samples and --finish are specified, the run loop
will terminate when either the current timestamp or sample count
reaches the end of the time window. If neither are set, run()
continues to the end of the archive, as normal.
Using sample count OR finish time to terminate the run loop
effectively avoids the problem in the BZ because --finish
no longer relies on the time delta to figure out when to stop.
qa/1588 exercises the fix.
Also note, qa/829 might need a tweak for testing pcp-dmcache(1),
which also uses pmcc.
commit 2484809b5096b70252f5a659833150951538cb6f
Author: Mark Goodwin <mgoodwin>
Date: Thu May 16 16:42:09 2019 +1000
qa: add qa/1588 to test python pmcc time window handling
See BZ 1671818 - pcp ignores --finish=time option
Next commit to src/python/pcp/pmcc.py fixes it.
Closing this WONTFIX for RHEL6 - multiple workarounds are available (see Comment #3) and secondly, PCP archives are both forward and backward compatible with any PCP release - so PCP archives captured on RHEL6 can be replayed and analysed on later versions of PCP. |