Add a timestamp to virDomainInfo ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The primary use of the virDomainInfo data is in calculating resource
utilization over time. The CPU runtime data, however, is represented
as a counter, so to calulate utilization requires some transformations.
Basically subtract the CPU runtime value for time X, from the value
at time Y, and divide the result by Y-X. Obviously this requires us to
know the times X & Y. Currently the virDomainInfo structure does not
contain this information though, so apps have to call something like
gettimeofday() before virDomainGetInfo(), to record the timestamp of each
virDomainInfo record.

The problem is that this is a pretty poor approximation - particularly
if libvirt is talking via XenD, a non-trivial period of time can pass
between the call to gettimeofday() and the values for virDomainInfo 
actually sampled.

Thus I would like to suggest that the virtDomainInfo structure be expanded
to add an extra data field of type 'struct timeval' to record a high
resolution timestamp. Now currently this wouldn't help accuracy all that 
much, since libvirt would still be filling this in much the same way as
the app did. It does however, open the door to having Xen itself provide
an accurate timestamp back to libvirt, which would in turn benefit apps
without requiring further code change.

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]