From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRQFU-00015o-Qs for qemu-devel@nongnu.org; Fri, 27 Feb 2015 14:07:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRQFT-00067J-R6 for qemu-devel@nongnu.org; Fri, 27 Feb 2015 14:06:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRQFT-00066r-DA for qemu-devel@nongnu.org; Fri, 27 Feb 2015 14:06:55 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1RJ6sRf026870 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 27 Feb 2015 14:06:54 -0500 From: "Dr. David Alan Gilbert (git)" Date: Fri, 27 Feb 2015 19:06:50 +0000 Message-Id: <1425064012-23155-1-git-send-email-dgilbert@redhat.com> Subject: [Qemu-devel] [PATCH 0/2] RFC: Rolling statistics List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: amit.shah@redhat.com, armbru@redhat.com, quintela@redhat.com From: "Dr. David Alan Gilbert" 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