Re: [Qemu-block] [PATCH v3 09/21] block: Add average I/O queue depth to BlockDeviceTimedStats

2015-10-23 Thread Alberto Garcia
On Fri 23 Oct 2015 03:31:38 PM CEST, Stefan Hajnoczi wrote: >> +uint64_t timed_average_sum(TimedAverage *ta, uint64_t *elapsed) >> +{ >> +TimedAverageWindow *w; >> +check_expirations(ta); >> +w = current_window(ta); >> +if (elapsed != NULL) { >> +

Re: [Qemu-block] [PATCH v3 09/21] block: Add average I/O queue depth to BlockDeviceTimedStats

2015-10-23 Thread Stefan Hajnoczi
On Thu, Oct 22, 2015 at 11:11:19AM +0300, Alberto Garcia wrote: > +/* Get the sum of all accounted values > + * @ta: the TimedAverage structure > + * @elapsed: if non-NULL, the elapsed time (in ns) will be stored here > + * @ret: the sum of all accounted values > + */ > +uint64_t

[Qemu-block] [PATCH v3 09/21] block: Add average I/O queue depth to BlockDeviceTimedStats

2015-10-22 Thread Alberto Garcia
This patch adds two new fields to BlockDeviceTimedStats that track the average number of pending read and write requests for a block device. The values are calculated for the period of time defined for that interval. Signed-off-by: Alberto Garcia --- block/accounting.c