qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC v2 0/4] Rolling statistics utilities
@ 2015-03-04 10:29 Dr. David Alan Gilbert (git)
  2015-03-04 10:29 ` [Qemu-devel] [RFC v2 1/4] RollingStats qapi type Dr. David Alan Gilbert (git)
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2015-03-04 10:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: amit.shah, armbru, qemu-block, quintela

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-04 10:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-04 10:29 [Qemu-devel] [RFC v2 0/4] Rolling statistics utilities Dr. David Alan Gilbert (git)
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)

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).