Welcome! Log In Create A New Profile

Advanced

Re: counters

February 28, 2013 04:23PM
пример я обновил

========================================================
http {
# allocating 10Mb for counetr with name "host_counter"
# and hashing function by $client_ip
counter_zone host_counter $client_ip 10m;

# same for "hit_counter"
counter_zone hit_counter $client_ip 10m;

...

server {

...

location ^~ /some/stats/ {
counter host_counter 1; #increase host_counter by one
}

location ^~ /some/stats/hit/ {
counter hit_counter 3; #increase hit_counter by some other value
}

location ^~ /some/other/stats/ {
counter host_counter $inc_var; #increase counter by some variable atoi
}

location ~* /stats/get_counter/(?P<id>.*)$ {
counter_get host_counter $counter $id;
return 200 $counter;
}

location ~* /stats/counter_get/(?P<id>.*)$ {
counter_get host_counter $counter $id;
return 200 $counter;
}

location ~* /stats/counter_drop/(?P<id>.*)$ {
counter_drop host_counter $id;
}
Subject Author Posted

counters

theromis1 February 28, 2013 01:32PM

Re: counters

Михаил Монашёв February 28, 2013 02:32PM

Re: counters

theromis1 February 28, 2013 04:23PM

Re[2]: counters

Михаил Монашёв March 01, 2013 01:24AM

Re: Re[2]: counters

Rush March 01, 2013 04:48AM

Re: Re[2]: counters

theromis1 March 01, 2013 10:51AM

Re: counters

Rush February 28, 2013 02:34PM

Re: counters

theromis1 February 28, 2013 04:02PM

Re: counters

Andrey Repin February 28, 2013 05:52PM

Re: counters

theromis1 February 28, 2013 06:19PM

Re: counters

Andrey Repin February 28, 2013 07:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 310
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready