Whamcloud - gitweb
LU-11407 obdclass: add start time to stats files 01/33201/10
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 19 Sep 2018 21:08:47 +0000 (17:08 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 27 Oct 2021 00:35:31 +0000 (00:35 +0000)
commitea2cd3af7bfabfa6876727ee44495f4c331bea8e
tree8b9d59f76440071956530d587a97d1bd598d09a1
parent9a5bace55a5ddb8a928af2de1b199e968f3fbecd
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.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iacefa17def455ef53a28fd14b6d4c670463ebbe5
Reviewed-on: https://review.whamcloud.com/33201
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Ben Evans <beevans@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
17 files changed:
lustre/include/lprocfs_status.h
lustre/include/lustre_osc.h
lustre/include/obd.h
lustre/llite/llite_internal.h
lustre/llite/lproc_llite.c
lustre/mdc/lproc_mdc.c
lustre/mdt/mdt_lproc.c
lustre/obdclass/genops.c
lustre/obdclass/lprocfs_jobstats.c
lustre/obdclass/lprocfs_status.c
lustre/osc/lproc_osc.c
lustre/osd-ldiskfs/osd_io.c
lustre/osd-ldiskfs/osd_lproc.c
lustre/osd-zfs/osd_io.c
lustre/osd-zfs/osd_lproc.c
lustre/utils/llobdstat
lustre/utils/llstat