qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH v4 1/3] qmp: Support for querying stats
Date: Fri, 11 Mar 2022 13:12:02 +0000	[thread overview]
Message-ID: <YitKou/lAlsbudNy@redhat.com> (raw)
In-Reply-To: <87a6dw7i55.fsf@pond.sub.org>

On Fri, Mar 11, 2022 at 02:06:46PM +0100, Markus Armbruster wrote:
> Mark Kanda <mark.kanda@oracle.com> writes:
> 
> > Introduce QMP support for querying stats. Provide a framework for adding new
> > stats and support for the following commands:
> >
> > - query-stats
> > Returns a list of all stats per target type (only VM and vCPU to start), with
> > additional options for specifying stat names, vCPU qom paths, and providers.
> >
> > - query-stats-schemas
> > Returns a list of stats included in each target type, with an option for
> > specifying the provider.
> >
> > The framework provides a method to register callbacks for these QMP commands.
> >
> > The first use-case will be for fd-based KVM stats (in an upcoming patch).
> >
> > Examples (with fd-based KVM stats):
> >
> > - Query all VM stats:
> >
> > { "execute": "query-stats", "arguments" : { "target": "vm" } }
> >
> > { "return": {
> >   "vm": [
> >      { "provider": "kvm",
> >        "stats": [
> >           { "name": "max_mmu_page_hash_collisions", "value": 0 },
> >           { "name": "max_mmu_rmap_size", "value": 0 },
> >           { "name": "nx_lpage_splits", "value": 148 },
> >           ...
> >      { "provider": "xyz",
> >        "stats": [ ...
> >      ...
> > ] } }
> >
> > - Query all vCPU stats:
> >
> > { "execute": "query-stats", "arguments" : { "target": "vcpu" } }
> >
> > { "return": {
> >     "vcpus": [
> >       { "path": "/machine/unattached/device[0]"
> >         "providers": [
> >           { "provider": "kvm",
> >             "stats": [
> >               { "name": "guest_mode", "value": 0 },
> >               { "name": "directed_yield_successful", "value": 0 },
> >               { "name": "directed_yield_attempted", "value": 106 },
> >               ...
> >           { "provider": "xyz",
> >             "stats": [ ...
> >            ...
> >       { "path": "/machine/unattached/device[1]"
> >         "providers": [
> >           { "provider": "kvm",
> >             "stats": [...
> >           ...
> > } ] } }
> >
> > - Query 'exits' and 'l1d_flush' KVM stats, and 'somestat' from provider 'xyz'
> > for vCPUs '/machine/unattached/device[2]' and '/machine/unattached/device[4]':
> >
> > { "execute": "query-stats",
> >   "arguments": {
> >     "target": "vcpu",
> >     "vcpus": [ "/machine/unattached/device[2]",
> >                "/machine/unattached/device[4]" ],
> >     "filters": [
> >       { "provider": "kvm",
> >         "fields": [ "l1d_flush", "exits" ] },
> >       { "provider": "xyz",
> >         "fields": [ "somestat" ] } ] } }
> 
> Are the stats bulky enough to justfify the extra complexity of
> filtering?

I viewed it more as a mechanism to cope with a scenario where
some stats are expensive to query. If the mgmt app only want
to get one specific cheap stat, we don't want to trigger code
that does expensive queries of other stats as a side effect.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2022-03-11 13:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 15:04 [PATCH v4 0/3] Support fd-based KVM stats Mark Kanda
2022-02-15 15:04 ` [PATCH v4 1/3] qmp: Support for querying stats Mark Kanda
2022-03-11 13:06   ` Markus Armbruster
2022-03-11 13:12     ` Daniel P. Berrangé [this message]
2022-03-14 17:28     ` Mark Kanda
2022-03-21 13:50       ` Markus Armbruster
2022-03-21 14:55         ` Paolo Bonzini
2022-03-21 15:18           ` Mark Kanda
2022-02-15 15:04 ` [PATCH v4 2/3] hmp: " Mark Kanda
2022-02-15 15:04 ` [PATCH v4 3/3] kvm: Support for querying fd-based stats Mark Kanda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YitKou/lAlsbudNy@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).