LU-11407 obdclass: add start time to stats files
When the stats files are initialized or reset, store the current
timestamp with the stats. That allows computing average IO and
RPC rates over the accumulated stats lifetime, in addition to the
normal incremental operation rates found by comparing successive
values read from the stats file with the read interval.
Any stats that currently print the "snapshot_time:" header will
now also print "start_time:" and "elapsed_time:" fields as well.
Consolodate this printing into a helper function instead of
duplicating very similar code in many different functions. Output
can't be exactly the same for all callers, because these fields are
embedded into different types of output files, but it is very close.
Change struct rename_stats and brw_stats to use a common name prefix.
Change the obd_job_stats timestamps to ktime_t so that we can use the
common helper function for printing the header. It is easier to store
ojs_cleanup_interval internally as 1/2 of the maximum stats age, since
since division is more easily done when the value is initially set as
seconds compared to when it is ktime_t. This may also be a tiny bit
more efficient since we don't do a divide/shift on each access.
Lustre-change: https://review.whamcloud.com/33201
Lustre-commit:
ea2cd3af7bfabfa6876727ee44495f4c331bea8e
LU-16231 misc: fix stats snapshot_time to use wallclock
merged into this patch here to avoid landing broken stats.
Some "init" times were not initialized when stats were allocated or
cleared, do this for all stats shown by lprocfs_stats_header().
Rename struct osc_device fields from od_ to osc_ to avoid confusion
with struct osd_device. Having two od_stats was especially confusing.
Add a test case to verify snapshot_time, start_time, elapsed_time.
Lustre-change: https://review.whamcloud.com/48821
Lustre-commit:
e42efe35eec7b9725f7f4fff86aaee04093366b0
LU-16110 lprocfs: make job_stats and rename_stats valid YAML
related to lprocfs_stats_header() are include here that were not
present when that patch was backported. This fixes the output to
correctly indent the items to follow YAML formatting rules.
Lustre-change: https://review.whamcloud.com/48417
Lustre-commit:
e96cb6ff1fea7a2bc62a6c0786fb0e07cbfda81a
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iacefa17def455ef53a28fd14b6d4c670463ebbe5
Reviewed-by: Ben Evans <beevans@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Feng Lei <flei@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/49745
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>