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

Re: [Xen-API] value of timestamp from API event.from() is always '0'



> On 17 Sep 2015, at 13:39, Uli Stärk <Uli.Staerk@xxxxxxxxxxxxxx> wrote:
> 
> Hey Tony,
> 
> I've seen this too. I don't know what the events.from was designed for. I've 
> seen XenCenter using it for a "fast"-sync with the pool, and features some 
> kind of logging (see id=0, class=message). I think you can safely skip all 
> events with id=0 and accept the ts=0 as given :)

I’ve cc:d Jonathan Ludlam, who built the `event.from` mechanism — he can 
probably describe the fine-detail.

The main semantic difference between `event.next` and `event.from` from my 
point-of-view is that `event.next` reads from a fixed-space queue of object 
state snapshots which can easily overflow, while `event.from` fetches the 
*current* state of all objects which have changed since your last update. If 
you want to display the most up-to-date information — like XenCenter does — 
then `event.from` is the way to go. We also had a lot of problems with the 
`event.next` queue overflowing, especially under heavy load (e.g. while 
starting lots of VMs). This caused `event.next` to return a lot of exceptions, 
which means you have to re-register for events and poll the current state of 
the objects again, adding even more load to the overloaded system.

I recommend using `event.from` if you can :-)

Cheers,
Dave Scott


> 
> I handle the pool syncing a little bit different, which is slower, bit a bit 
> more straight forward:
> 1. event.register(*)
> 2. foreach($obj_types as $type) $type.get_all()
> 3. while($running) event.next()
> 
> Greetings
> Uli Stärk
> 
> -----Ursprüngliche Nachricht-----
> Von: xen-api-bounces@xxxxxxxxxxxxx [mailto:xen-api-bounces@xxxxxxxxxxxxx] Im 
> Auftrag von tony_caotong@xxxxxxx
> Gesendet: Mittwoch, 16. September 2015 04:39
> An: xen-users@xxxxxxxxxxxxx; xen-api@xxxxxxxxxxxxx
> Betreff: [Xen-API] value of timestamp from API event.from() is always '0'
> 
> Hi all,
> 
>     My xenserver version is 6.2
>     When I fetch logs from API function event.from(), the value of each 
> timestamp field is always '0.' .
>     Instead of event.next(), it is fine.
>     Could anyone give me some advices ?
> 
> --
> -----------
> Cao Tong
> 
> 
> 
> _______________________________________________
> Xen-api mailing list
> Xen-api@xxxxxxxxxxxxx
> http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api
> 
> _______________________________________________
> Xen-api mailing list
> Xen-api@xxxxxxxxxxxxx
> http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


_______________________________________________
Xen-api mailing list
Xen-api@xxxxxxxxxxxxx
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.