[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] block: latency accounting
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] block: latency accounting |
Date: |
Fri, 26 Aug 2011 15:05:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 |
Am 25.08.2011 08:26, schrieb Christoph Hellwig:
> Account the total latency for read/write/flush requests. This allows
> management tools to average it based on a snapshot of the nr ops
> counters and allow checking for SLAs or provide statistics.
>
> Signed-off-by: Christoph Hellwig <address@hidden>
>
> Index: qemu/block.c
> ===================================================================
> --- qemu.orig/block.c 2011-08-25 08:01:12.000000000 +0200
> +++ qemu/block.c 2011-08-25 08:03:02.908005646 +0200
> @@ -1889,12 +1889,18 @@ static void bdrv_stats_iter(QObject *dat
> " rd_operations=%" PRId64
> " wr_operations=%" PRId64
> " flush_operations=%" PRId64
> + " wr_total_time_ns=%" PRId64
> + " rd_total_time_ns=%" PRId64
> + " flush_total_time_ns=%" PRId64
> "\n",
> qdict_get_int(qdict, "rd_bytes"),
> qdict_get_int(qdict, "wr_bytes"),
> qdict_get_int(qdict, "rd_operations"),
> qdict_get_int(qdict, "wr_operations"),
> - qdict_get_int(qdict, "flush_operations"));
> + qdict_get_int(qdict, "flush_operations"),
> + qdict_get_int(qdict, "wr_total_time_ns"),
> + qdict_get_int(qdict, "rd_total_time_ns"),
> + qdict_get_int(qdict, "flush_total_time_ns"));
> }
>
> void bdrv_stats_print(Monitor *mon, const QObject *data)
> @@ -1913,7 +1919,10 @@ static QObject* bdrv_info_stats_bs(Block
> "'rd_operations': %" PRId64 ","
> "'wr_operations': %" PRId64 ","
> "'wr_highest_offset': %" PRId64 ","
> - "'flush_operations': %" PRId64
> + "'flush_operations': %" PRId64 ","
> + "'wr_total_time_ns': %" PRId64 ","
> + "'rd_total_time_ns': %" PRId64 ","
> + "'flush_total_time_ns': %" PRId64
> "} }",
> bs->nr_bytes[BDRV_ACCT_READ],
> bs->nr_bytes[BDRV_ACCT_WRITE],
> @@ -1921,7 +1930,10 @@ static QObject* bdrv_info_stats_bs(Block
> bs->nr_ops[BDRV_ACCT_WRITE],
> bs->wr_highest_sector *
> (uint64_t)BDRV_SECTOR_SIZE,
> - bs->nr_ops[BDRV_ACCT_FLUSH]);
> + bs->nr_ops[BDRV_ACCT_FLUSH],
> + bs->total_time_ns[BDRV_ACCT_READ],
> + bs->total_time_ns[BDRV_ACCT_WRITE],
> + bs->total_time_ns[BDRV_ACCT_FLUSH]);
The order of READ vs. WRITE is wrong here, so read latencies show up as
wr_total_time. I can fix it locally if you agree that swapping the two
lines is the right fix.
Kevin
- Re: [Qemu-devel] [PATCH 0/3] better I/O accounting V2, (continued)
- Re: [Qemu-devel] [PATCH 0/3] better I/O accounting V2, Ryan Harper, 2011/08/22
- Re: [Qemu-devel] [PATCH 0/3] better I/O accounting V2, Christoph Hellwig, 2011/08/22
- Re: [Qemu-devel] [PATCH 0/3] better I/O accounting V2, Ryan Harper, 2011/08/22
- Re: [Qemu-devel] [PATCH 0/3] better I/O accounting V2, Christoph Hellwig, 2011/08/24
- Re: [Qemu-devel] [PATCH 0/3] better I/O accounting V2, Ryan Harper, 2011/08/25
Re: [Qemu-devel] [PATCH 0/3] better I/O accounting V2, Kevin Wolf, 2011/08/22
Re: [Qemu-devel] [PATCH 0/3] better I/O accounting V3, Christoph Hellwig, 2011/08/25
Re: [Qemu-devel] [PATCH 0/3] better I/O accounting V3, Kevin Wolf, 2011/08/25