[libvirt] [PATCH 7/7] libvirt-domain: Document interface stats POV

Michal Privoznik posted 7 patches 7 years, 7 months ago
[libvirt] [PATCH 7/7] libvirt-domain: Document interface stats POV
Posted by Michal Privoznik 7 years, 7 months ago
Interestingly enough, we don't document the point of view of the
interface statistics. Therefore it's unknown to users if for
instance rx_packets is the number of packets received by domain or
received by host (from domain). Document this explicitly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/libvirt-domain.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index d70027163..d2d022a66 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -5523,6 +5523,8 @@ virDomainBlockStatsFlags(virDomainPtr dom,
  * as -1, which indicates that the hypervisor does not support
  * that particular statistic.
  *
+ * The returned stats are from domain's point of view.
+ *
  * Returns: 0 in case of success or -1 in case of failure.
  */
 int
@@ -11301,7 +11303,7 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
  *                         as unsigned long long.
  *
  * VIR_DOMAIN_STATS_INTERFACE:
- *     Return network interface statistics.
+ *     Return network interface statistics (from domain point of view).
  *     The typed parameter keys are in this format:
  *
  *     "net.count" - number of network interfaces on this domain
-- 
2.13.5

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 7/7] libvirt-domain: Document interface stats POV
Posted by John Ferlan 7 years, 7 months ago

On 10/02/2017 11:05 AM, Michal Privoznik wrote:
> Interestingly enough, we don't document the point of view of the
> interface statistics. Therefore it's unknown to users if for
> instance rx_packets is the number of packets received by domain or
> received by host (from domain). Document this explicitly.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/libvirt-domain.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 

Maybe we should be even more explicit vis-a-vis when certain types of
interface stats are swapped - direct & ethernet keep the same/current
view, but every other type is changing. I know/understand this is a
"tricky" and "slippery" slope in order to keep up with in the future,
but I think some wording could be generated that would suffice

Also a followup patch should modify docs/news.xml!


Reviewed-by: John Ferlan <jferlan@redhat.com>

John


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 7/7] libvirt-domain: Document interface stats POV
Posted by Michal Privoznik 7 years, 7 months ago
On 10/05/2017 12:49 AM, John Ferlan wrote:
> 
> 
> On 10/02/2017 11:05 AM, Michal Privoznik wrote:
>> Interestingly enough, we don't document the point of view of the
>> interface statistics. Therefore it's unknown to users if for
>> instance rx_packets is the number of packets received by domain or
>> received by host (from domain). Document this explicitly.
>>
>> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>> ---
>>  src/libvirt-domain.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
> 
> Maybe we should be even more explicit vis-a-vis when certain types of
> interface stats are swapped - direct & ethernet keep the same/current
> view, but every other type is changing. I know/understand this is a
> "tricky" and "slippery" slope in order to keep up with in the future,
> but I think some wording could be generated that would suffice

I'm not fully convinced about this. I mean, it's just our implementation
detail that we read stats from the host and therefore have to swap
fields sometimes. The whole point of this series is that users reading
stats do not need to fix/swap the fields themselves depending on the
interface type.

> 
> Also a followup patch should modify docs/news.xml!

Ah right. I'll send it right away.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list