]> git.proxmox.com Git - mirror_qemu.git/commit - util/timed-average.c
util: Infrastructure for computing recent averages
authorAlberto Garcia <berto@igalia.com>
Wed, 28 Oct 2015 15:33:01 +0000 (17:33 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 12 Nov 2015 15:22:45 +0000 (16:22 +0100)
commitbd797fc15b4290e02c219b7cd6289a33cd6cd18b
tree04242c8d6097bba0e8f4f19ec0097b0a935d39f0
parent5519593c07c71c55b196546a00c08106bd9a100b
util: Infrastructure for computing recent averages

This module computes the average of a set of values within a time
window, keeping also track of the minimum and maximum values.

In order to produce more accurate results it works internally by
creating two time windows of the same period, offsetted by half of
that period. Values are accounted on both windows and the data is
always returned from the oldest one.

[Add missing util/replay.o to test-timed-average dependencies to fix the
build.
--Stefan]

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 201b09c21bbc9c329779d2b2365ee2b9c80dceeb.1446044837.git.berto@igalia.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
include/qemu/timed-average.h [new file with mode: 0644]
tests/Makefile
tests/test-timed-average.c [new file with mode: 0644]
util/Makefile.objs
util/timed-average.c [new file with mode: 0644]