Welcome! Log In Create A New Profile

Advanced

best way to get a 1-second timer-tick?

Neil Mckee
April 22, 2011 02:04PM
Hello,

I have written a module to implement sFlow in nginx (nginx-sflow-module.googlecode.com). I'm simulating a 1-second timer-tick by assuming that the request handler will be called at least once per second. That's probably a safe assumption for any server that would care about sFlow monitoring, but I expect there's a better way...

I tried asking for a timer callback like this:

ngx_event_t *ev = ngx_pcalloc(pool, sizeof(ngx_event_t));
ev->hander = ngx_http_sflow_tick_event_hander;
ngx_add_timer(ev, 1000);

but (like most russian girls) the event never called me back. It looks like I might have to hang this on a file-descriptor somehow, but that's where I'm getting lost. Any pointers would be most appreciated.

Neil



_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

best way to get a 1-second timer-tick?

Neil Mckee 3189 April 22, 2011 02:04PM

Re: best way to get a 1-second timer-tick?

Arnaud GRANAL 846 April 22, 2011 02:10PM

Re: best way to get a 1-second timer-tick?

Maxim Dounin 753 April 23, 2011 05:06AM

Re: best way to get a 1-second timer-tick?

Arnaud GRANAL 990 April 23, 2011 06:40AM

Re: best way to get a 1-second timer-tick?

Neil Mckee 681 September 06, 2013 03:16PM

Re: best way to get a 1-second timer-tick?

Maxim Dounin 552 September 09, 2013 07:36AM

Re: best way to get a 1-second timer-tick?

Maxim Dounin 848 April 23, 2011 05:04AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 170
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready