-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: high resolution timestamp variable #6
Comments
Patches welcome! :) |
clock_gettime required rt lib, not sure if it's good idea |
I have set_hires_time (wrong name, it's not related to time, it's CPU cycles) location /hires.html {
default_type plain/html;
set_hires_time $hires1;
set_hires_time $hires2;
let $hires ( $hires2 - $hires1 );
echo $hires1;
echo $hires2;
echo $hires;
break;
} return something like PS. nginx 1.4.4, used nginx-let-module, echo-nginx-module, my fork of set-misc-nginx-module |
@TrurlMcByte seems like it's only useful for timing an ngx_rewrite command :) |
with echo_location working too ) location = /hires1.html {
default_type plain/html;
echo_reset_timer;
echo_location /hires1;
echo_location /hires2;
echo "took $echo_timer_elapsed sec for total.";
}
location = /hires1 {
echo_sleep 1.0;
set_hires_time $hires1;
echo $hires1;
}
location = /hires2 {
set_hires_time $hires2;
echo $hires2;
} 20803416887362244 3415290412 cycles difference for 1.001 seconds is not bad precision ) |
I just had to say... @TrurlMcByte can't believe I just found you around here! \o/ |
Hello,
I'd like to put a timestamp into my upstream request URIs (or include it as a request header with the HeardsMore module), so it'd be great if you could implement a few other special variables:
Thanks!
[0] http://stackoverflow.com/questions/88/is-gettimeofday-guaranteed-to-be-of-microsecond-resolution/367#367
The text was updated successfully, but these errors were encountered: