search for: record_stat

Displaying 4 results from an estimated 4 matches for "record_stat".

2019 Nov 30
0
[PATCH nbdkit v2 2/3] filters: stats: Measure time per operation
...p;zero_st); + print_stat (&extents_st); + print_stat (&cache_st); fflush (fp); } @@ -187,11 +202,18 @@ stats_config_complete (nbdkit_next_config_complete *next, void *nxdata) "statsappend=<BOOL> True to append to the log (default false).\n" static inline void -record_stat (stat *st, uint32_t count) +record_stat (stat *st, uint32_t count, struct timeval *start) { + struct timeval end; + uint64_t usecs; + + gettimeofday(&end, NULL); + usecs = tvdiff_usec(start, &end); + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); st->ops++; st->bytes += cou...
2019 Nov 30
4
[PATCH nbdkit v2 0/3] filters: stats: More useful, more friendly
...Add missing stats for flush I hope that these changes will help to understand and improve virt-v2v performance. Changes since v1: - Keep bytes values - Increase precision to 0.001 GiB and 0.001 MiB/s - Add total stats - Show time before size/rate for more consistent format - Streamline using new record_stat() and print_stat() v1 was here: https://www.redhat.com/archives/libguestfs/2019-November/msg00345.html Nir Soffer (3): filters: stats: Add size in GiB, show rate in MiB/s filters: stats: Measure time per operation filters: stats: Add flush stats filters/stats/stats.c | 108 +++++++++++++++...
2019 Nov 30
0
[PATCH nbdkit v2 3/3] filters: stats: Add flush stats
...} +/* Flush. */ +static int +stats_flush (struct nbdkit_next_ops *next_ops, void *nxdata, + void *handle, uint32_t flags, + int *err) +{ + struct timeval start; + int r; + + gettimeofday (&start, NULL); + r = next_ops->flush (nxdata, flags, err); + if (r == 0) record_stat (&flush_st, 0, &start); + return r; +} + /* Zero. */ static int stats_zero (struct nbdkit_next_ops *next_ops, void *nxdata, @@ -325,6 +348,7 @@ static struct nbdkit_filter filter = { .pread = stats_pread, .pwrite = stats_pwrite, .trim = stats...
2020 Oct 17
0
[PATCH nbdkit] common/include/tvdiff.h: Add formal specification.
...usecs; gettimeofday (&now, NULL); - usecs = tvdiff_usec (&start_t, &now); + tvdiff_usec (&start_t, &now, &usecs); if (fp && usecs > 0) { ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); print_stats (usecs); @@ -247,10 +247,10 @@ static inline void record_stat (nbdstat *st, uint32_t count, const struct timeval *start) { struct timeval end; - uint64_t usecs; + int64_t usecs; gettimeofday (&end, NULL); - usecs = tvdiff_usec (start, &end); + tvdiff_usec (start, &end, &usecs); ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); s...