Idea for a statistics module

zepolen zepolen at gmail.com
Fri Oct 9 04:41:55 MSD 2009


It doesn't seem to be tracking the request time properly, the counts
remain at 0 for all ranges.

Event-Accepted: 365
Event-Active: 160
Event-Handled: 365
Http-Requests-Reading: 0
Http-Requests-Writing: 1
Http-Requests-Total: 1754
Http-Time-Request:
	-0=0
	1-1=0
	2-4=0
	5-9=0
	10-19=0
	20-49=0
	50-99=0
	100-199=0
	200-499=0
	500-999=0
	1000-1999=0
	2000-4999=0
	5000-9999=0
	10000-19999=0
	20000-=0
Http-Requests-Active: 1
Http-Requests-Writing-File: 0
Http-Upstreams-Total: 1700
Http-Upstreams-Active: 0
Http-Cached: 0


2009/10/8 Tommie Gannert <tommie at spotify.com>:
> Hi!
>
> We felt the stub status module was a bit too non-modular for our
> internal services
> and created a statistics module where each module can allocate their
> stat counters
> more dynamically.
>
> It does have a hardcoded limit of around 64 counters currently, and
> any suggestion
> on how to make it dynamical is highly appreciated.
>
> Apart from adding another "increment the counter", it also requires
> the event and core
> modules to allocate the counters, why they have been given module init
> functions.
>
> You use it by adding
>
>  location /server-status {
>    statistics on;
>  }
>
> and requesting
>
>  http://example.com/sever-status
>
> for RFC822 formatted output or
>
>  http://example.com/sever-status?type=text/html
>
> for more human friendly text.
>
> The module adds the ability to use histograms of fixed bucket counts,
> but note that
> the counters will never be reset, so it is nowhere near a snapshot
> value. For that we use
> a monitoring/graphing system fed with the RFC822 output. This is also
> the reason why the
> default MIME type is text/plain, rather than text/html. The histograms
> are quite useful for plotting
> file sizes or request delays.
>
> Hope you find it useful. The original code contained in the patch is
> MIT licensed.
> Documentation of the code... in the future.
>
> --
> Tommie
>





More information about the nginx mailing list