From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org
Cc: amit.shah@redhat.com, armbru@redhat.com, qemu-block@nongnu.org,
quintela@redhat.com
Subject: [Qemu-devel] [RFC v2 0/4] Rolling statistics utilities
Date: Wed, 4 Mar 2015 10:29:35 +0000 [thread overview]
Message-ID: <1425464979-20578-1-git-send-email-dgilbert@redhat.com> (raw)
From: "Dr. David Alan Gilbert" <dgilbert@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 with fault-tolerance code and want to read the means
within qemu but also want to provide the values to higher levels
of the stack and to watch what is going on.
This version is lightly tested, and I'm still more interested
in if it's the right shape/idea rather than a detailed review.
I've included an example use in watching the 'expected downtime'
in migration; rather than the current single value we get:
HMP:
expected downtime stats: Min/Max: 222, 1634 Mean: 983.8 (Weighted:
1005.1253) Count: 141 Values: 1248@39356292, 981@39356395, 774@39356497,
876@39356599, 1040@39356702
QMP:
"expected-downtime-stats": {
"min": 222,
"count": 378,
"mean": 1100.2,
"max": 1942,
"weighted-mean": 1115.710848,
"values": [
{
"tag": 39380740,
"value": 1118
},
{
"tag": 39380842,
"value": 953
},
{
"tag": 39380945,
"value": 1017
},
{
"tag": 39381048,
"value": 1336
},
{
"tag": 39381150,
"value": 1077
}
]
}
Dave
RFC v2
Wired up a qapi type so that the output is done via qapi; it
still seems best to have a separate type with the data and
the locking etc.
Although that has lost my test harness that was built on my
manual formatters.
Dr. David Alan Gilbert (4):
RollingStats qapi type
Rolling statistics utilities
hmp: Add a helper function for printing out a Rolling Statistics set
Example use of rolling statistics in migration
hmp.c | 24 +++++
include/migration/migration.h | 1 +
include/qemu/rolling-stats.h | 87 ++++++++++++++++
include/qemu/typedefs.h | 1 +
migration/migration.c | 15 +++
qapi-schema.json | 36 ++++++-
util/Makefile.objs | 1 +
util/rolling-stats.c | 236 ++++++++++++++++++++++++++++++++++++++++++
8 files changed, 400 insertions(+), 1 deletion(-)
create mode 100644 include/qemu/rolling-stats.h
create mode 100644 util/rolling-stats.c
--
2.1.0
next reply other threads:[~2015-03-04 10:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-04 10:29 Dr. David Alan Gilbert (git) [this message]
2015-03-04 10:29 ` [Qemu-devel] [RFC v2 1/4] RollingStats qapi type Dr. David Alan Gilbert (git)
2015-03-04 10:29 ` [Qemu-devel] [RFC v2 2/4] Rolling statistics utilities Dr. David Alan Gilbert (git)
2015-03-04 10:29 ` [Qemu-devel] [RFC v2 3/4] hmp: Add a helper function for printing out a Rolling Statistics set Dr. David Alan Gilbert (git)
2015-03-04 10:29 ` [Qemu-devel] [RFC v2 4/4] Example use of rolling statistics in migration Dr. David Alan Gilbert (git)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1425464979-20578-1-git-send-email-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=amit.shah@redhat.com \
--cc=armbru@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).