[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4] qga: add guest-get-diskstats command for Linux guests
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v4] qga: add guest-get-diskstats command for Linux guests |
Date: |
Thu, 19 May 2022 15:57:17 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
luzhipeng <luzhipeng@cestc.cn> writes:
> Add a new 'guest-get-diskstats' command for report disk io statistics
> for Linux guests. This can be useful for getting io flow or handling
> IO fault, no need to enter guests.
>
> Signed-off-by: luzhipeng <luzhipeng@cestc.cn>
[...]
> diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
> index 4d8e506c9e..75d2bddf4b 100644
> --- a/qga/qapi-schema.json
> +++ b/qga/qapi-schema.json
> @@ -1490,3 +1490,89 @@
> { 'command': 'guest-ssh-remove-authorized-keys',
> 'data': { 'username': 'str', 'keys': ['str'] },
> 'if': 'CONFIG_POSIX' }
> +
> +##
> +# @GuestDiskStats:
> +#
> +# @read-sectors: sectors read
> +#
> +# @write-sectors: sectors written
> +#
> +# @discard-sectors: sectors discarded
> +#
> +# @read-ios: reads completed successfully
> +#
> +# @read-merges: Number of read requests merged
> +#
> +# @write-ios: writes completed
> +#
> +# @write-merges: Number of write requests merged
> +#
> +# @discard-ios: Number of discards completed successfully
> +#
> +# @discard-merges: NUmber of discard requests merged
Typo in "Number".
> +#
> +# @flush-ios: Number of flush requests completed successfully
> +#
> +# @read-ticks: time spent reading(ms)
> +#
> +# @write-ticks: time spent writing(ms)
> +#
> +# @discard-ticks: time spent discarding(ms)
> +#
> +# @flush-ticks: time spent flushing(ms)
> +#
> +# @ios-pgr: Number of I/Os currently in flight
> +#
> +# @total-ticks: time spent doing I/Os (ms)
> +#
> +# @weight-ticks: weighted time spent doing I/Os since the last update of
> this field(ms)
Some descriptions start with lower case, some with upper case.
Recommend to pick one and stick with it. Lower case seems to be more
common in this schema.
> +#
> +# Since: 7.1
> +##
> +{ 'struct': 'GuestDiskStats',
> + 'data': {'*read-sectors': 'uint64',
> + '*write-sectors': 'uint64',
> + '*discard-sectors': 'uint64',
> + '*read-ios': 'uint64',
> + '*read-merges': 'uint64',
> + '*write-ios': 'uint64',
> + '*write-merges': 'uint64',
> + '*discard-ios': 'uint64',
> + '*discard-merges': 'uint64',
> + '*flush-ios': 'uint64',
> + '*read-ticks': 'uint64',
> + '*write-ticks': 'uint64',
> + '*discard-ticks': 'uint64',
> + '*flush-ticks': 'uint64',
> + '*ios-pgr': 'uint64',
> + '*total-ticks': 'uint64',
> + '*weight-ticks': 'uint64'
> + } }
> +
> +##
> +# @GuestDiskStatsInfo:
> +#
> +# @name disk name
> +#
> +# @major major of disk
> +#
> +# @minor minor of disk
Major and minor *what*?
> +##
> +{ 'struct': 'GuestDiskStatsInfo',
> + 'data': {'name': 'str',
> + 'major': 'uint64',
> + 'minor': 'uint64',
> + 'stats': 'GuestDiskStats' } }
> +
> +##
> +# @guest-get-diskstats:
> +#
> +# Retrieve information about disk stats.
> +# Returns: List of disk stats of guest.
> +#
> +# Since: 7.1
> +##
> +{ 'command': 'guest-get-diskstats',
> + 'returns': ['GuestDiskStatsInfo']
> +}