From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> Hi, This is an attempt at a generic rolling statistics utility to allow data (e.g. bandwidth usage, times etc) to be collected easily. They hold some basic values (min/max/mean/weighted mean) and the last 'n' raw values. I'd like to use this maybe in fault-tolerance code.
This is a first cut, and I think I probably need to rework it as a qapi type somehow, but I'm interested in thoughts. Dave Dr. David Alan Gilbert (2): Rolling statistics utilities Tests for rolling statistics code include/qemu/rolling-stats.h | 101 +++++++++++ include/qemu/typedefs.h | 1 + tests/Makefile | 3 + tests/test-rolling-stats.c | 161 ++++++++++++++++++ util/Makefile.objs | 1 + util/rolling-stats.c | 393 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 660 insertions(+) create mode 100644 include/qemu/rolling-stats.h create mode 100644 tests/test-rolling-stats.c create mode 100644 util/rolling-stats.c -- 2.1.0