public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOTEST] kvm: timedrift test: fix typo (host_delta_t)
@ 2010-02-03 13:27 Uri Lublin
  0 siblings, 0 replies; 3+ messages in thread
From: Uri Lublin @ 2010-02-03 13:27 UTC (permalink / raw)
  To: autotest, kvm; +Cc: lmr

Signed-off-by: Uri Lublin <uril@redhat.com>
---
 client/tests/kvm/tests/timedrift.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm/tests/timedrift.py b/client/tests/kvm/tests/timedrift.py
index b3e8770..06f6a70 100644
--- a/client/tests/kvm/tests/timedrift.py
+++ b/client/tests/kvm/tests/timedrift.py
@@ -160,7 +160,7 @@ def run_timedrift(test, params, env):
     # Report results
     host_delta_total = ht2 - ht0
     guest_delta_total = gt2 - gt0
-    drift_total = 100.0 * (host_delta_total - guest_delta_total) / host_delta
+    drift_total = 100.0 * (host_delta_total - guest_delta_total) / host_delta_total
     logging.info("Total host duration including rest: %.2f" % host_delta_total)
     logging.info("Total guest duration including rest: %.2f" % guest_delta_total)
     logging.info("Total drift after rest: %.2f%%" % drift_total)
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH AUTOTEST] kvm: timedrift test: fix typo (host_delta_t)
       [not found] <708754168.731111265207954850.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
@ 2010-02-03 14:47 ` Michael Goldish
  2010-02-04 21:38   ` Uri Lublin
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Goldish @ 2010-02-03 14:47 UTC (permalink / raw)
  To: Uri Lublin; +Cc: lmr, autotest, kvm


----- "Uri Lublin" <uril@redhat.com> wrote:

> Signed-off-by: Uri Lublin <uril@redhat.com>
> ---
>  client/tests/kvm/tests/timedrift.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/client/tests/kvm/tests/timedrift.py
> b/client/tests/kvm/tests/timedrift.py
> index b3e8770..06f6a70 100644
> --- a/client/tests/kvm/tests/timedrift.py
> +++ b/client/tests/kvm/tests/timedrift.py
> @@ -160,7 +160,7 @@ def run_timedrift(test, params, env):
>      # Report results
>      host_delta_total = ht2 - ht0
>      guest_delta_total = gt2 - gt0
> -    drift_total = 100.0 * (host_delta_total - guest_delta_total) /
> host_delta
> +    drift_total = 100.0 * (host_delta_total - guest_delta_total) /
> host_delta_total

This isn't a typo.
delta_total is the load duration (e.g. 1 min of video decoding) +
rest duration (e.g. 20 secs of idleness).
I think the load drift and the total drift should be divided by the
same delta, in order to determine the amount of drift corrected during
idleness.  If you divide the total drift by delta_total (instead of
delta) you give a false impression that more drift was corrected than
really was.

I'm not sure I'm making my point clearly so here's an example:

Let's assume:
- The load duration is 30s;
- the idle duration is 30s;
- the drift was 10s;
- the drift was not corrected at all during idleness -- so after the
idle period the drift remained 10s.

Then:
- The "load drift" is 33.3% (10/30);
- if you divide by delta, the "total drift" is still 33.3% (10/30);
- if you divide by delta_total, the "total drift" is 16.6% (10/60).

So dividing by delta_total gives the impression that some drift was
corrected, when in fact none was.

>      logging.info("Total host duration including rest: %.2f" %
> host_delta_total)
>      logging.info("Total guest duration including rest: %.2f" %
> guest_delta_total)
>      logging.info("Total drift after rest: %.2f%%" % drift_total)
> -- 
> 1.6.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH AUTOTEST] kvm: timedrift test: fix typo (host_delta_t)
  2010-02-03 14:47 ` [PATCH AUTOTEST] kvm: timedrift test: fix typo (host_delta_t) Michael Goldish
@ 2010-02-04 21:38   ` Uri Lublin
  0 siblings, 0 replies; 3+ messages in thread
From: Uri Lublin @ 2010-02-04 21:38 UTC (permalink / raw)
  To: Michael Goldish; +Cc: lmr, autotest, kvm

On 02/03/2010 04:47 PM, Michael Goldish wrote:
>
> ----- "Uri Lublin"<uril@redhat.com>  wrote:
>
>> Signed-off-by: Uri Lublin<uril@redhat.com>
>> ---
>>   client/tests/kvm/tests/timedrift.py |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/client/tests/kvm/tests/timedrift.py
>> b/client/tests/kvm/tests/timedrift.py
>> index b3e8770..06f6a70 100644
>> --- a/client/tests/kvm/tests/timedrift.py
>> +++ b/client/tests/kvm/tests/timedrift.py
>> @@ -160,7 +160,7 @@ def run_timedrift(test, params, env):
>>       # Report results
>>       host_delta_total = ht2 - ht0
>>       guest_delta_total = gt2 - gt0
>> -    drift_total = 100.0 * (host_delta_total - guest_delta_total) /
>> host_delta
>> +    drift_total = 100.0 * (host_delta_total - guest_delta_total) /
>> host_delta_total
>
> This isn't a typo.
> delta_total is the load duration (e.g. 1 min of video decoding) +
> rest duration (e.g. 20 secs of idleness).
> I think the load drift and the total drift should be divided by the
> same delta, in order to determine the amount of drift corrected during
> idleness.  If you divide the total drift by delta_total (instead of
> delta) you give a false impression that more drift was corrected than
> really was.
>
> I'm not sure I'm making my point clearly so here's an example:
>
> Let's assume:
> - The load duration is 30s;
> - the idle duration is 30s;
> - the drift was 10s;
> - the drift was not corrected at all during idleness -- so after the
> idle period the drift remained 10s.
>
> Then:
> - The "load drift" is 33.3% (10/30);
> - if you divide by delta, the "total drift" is still 33.3% (10/30);
> - if you divide by delta_total, the "total drift" is 16.6% (10/60).
>
> So dividing by delta_total gives the impression that some drift was
> corrected, when in fact none was.
>

O.K. That makes sense. Thanks for the explanation.

In your example, the "total drift" is 33% of "the load duration", which is a bit 
confusing.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-04 21:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <708754168.731111265207954850.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2010-02-03 14:47 ` [PATCH AUTOTEST] kvm: timedrift test: fix typo (host_delta_t) Michael Goldish
2010-02-04 21:38   ` Uri Lublin
2010-02-03 13:27 Uri Lublin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox