PageViews: 2,848 / 2,558 / 2,210 hits / 213 nets since Jun 29 2020
home updates download manual documents feedback search stats ITS more
DeleGateIcon

Access Counter and Statitics

DeleGate/9.9.13
2024-04-19/16:03:56
Nets Hits Refs Mail info manual SHTML source
Access Counters and Statistics by DeleGate
PageViews: 2,558 hits / 213 nets

Access counter and statistics by DeleGate

Yutaka Sato @ DeleGate.ORG
May 11, 2006

Basic functionality for access counters and real-time statistics were built-into DeleGate/9.2.0. It is applied not only to access count from clients but also to general counts including Referers, errors, and more, in future. So far, the following counters have been implemented.

  • count for each requested URL on origin/proxy HTTP DeleGate (example)
  • count for each Referer URL on origin/proxy HTTP DeleGate (example)
  • count for each transferred file on origin FTP DeleGate (example)
  • count for each error or rejection in SMTP DeleGate (example)
  • count for each session of FTP, SMTP, NNTP DeleGate (example)
  • count for each packet incoming to DNS DeleGate (example)
This built-in counter is intended to be used to show real-time statistics of DeleGate servers too. It will be convenient to be able to get statistics in real-time and without keeping a large volume of log files.


Basic Usage

Counters are enabled with the COUNTER parameter, as follows in the simplest.

    COUNTER=do

A SSI tag "COUNTER" is introduced to show values in counters. The simplest example is the access counter of the SHTML page including the tag.

    <!--#echo var=COUNTER -->
    2848
There are three types of counters based on (client's) IP address; the first one is incremented on every hit, the second one is incremented excluding repetitive hit by the same IP address, and the third one is incremented excluding repetitive hit by one of last ten IP addresses. Each counter is represented with %T, %U, and %V respectively in a format string given by the fmt="formatString" attribute.
    <!--#echo var=COUNTER fmt="%T : %U : %V hits / %N nets (since %tC)" -->
    2848 : 2558 : 2210 hits / 213 nets (since Jun 29 2020)
Yet another count is "network count" which is represented as "%N" in the format string. It is introduced to be a metrics of the coverage or distribution of (client's) IP addresses on the address space. It is not a counter incremented on each hit, but the number of bits in a bit map of network addresses. In the current implementation, the width of the network mask is 10 bits, therefore the logical maximum number of "%N" is 1024. The map of networks can be shown with "%M" as follows.
    <!--#echo var=COUNTER fmt="%M" -->
    
      0.0.0.0 -------X ----XX2X ----XXXX -------- --XX---- -------- ----X--X --------
     16.0.0.0 ----XX-X X-XX---- X--X---- ----8XX- X------- -------- -------- ----X---
     32.0.0.0 -------- -X-X-X-X ------X- --X--X-- -X-----X ---X---- ---XXXX- X-XXXX--
     48.0.0.0 ----X--- -X---X-X XXX5---- 0XXX---- -------- ---X---- ------X- ---X----
     64.0.0.0 XX--XX-- --XX---- -------- -------- -X------ -X------ -X---6-X XXX-----
     80.0.0.0 ------XX --X----- X---X--X -------X -X-XX-X- --X---XX ---X--XX --X--XXX
     96.0.0.0 -----X-- -------- X---X--- --X----X X-X----- -XXXX--- -----X-- -----X-X
    112.0.0.0 ----X--X -X-X---- --XX-X-X ----X-X- ----X--- ----XX-- --X-X--- --------
    128.0.0.0 -------- ---X---- ----X-X- -X----X- --XX--X- -X-XX--- -----X-- --X----X
    144.0.0.0 -X-X---- -----X-X -------X -X---1-- X------- X------- ----XX-X -X---X-X
    160.0.0.0 ---X---- X--X---- -------- -X---X-- --7----- ---X---- -------X --------
    176.0.0.0 X------- X-X----- --X----- X------X XX--X-XX X-X----- X-X----- -----XX-
    192.0.0.0 XX----XX ---X-XXX -X----X- -X-X-X-X -X------ ---X-XX- ------X- ----X---
    208.0.0.0 ----X-X- ---X---X -XX---X- -------- XX-4-3X- X------- --X----- -------X
    
In the map, each true bit is marked with 'X' while false bit is marked with '-'. The recent ten networks are marked with a digit from '0' to '9'. The recent ten IP addresses can be shown with "%L" as follows.
    <!--#echo var=COUNTER fmt="%L" -->
    
    LAST[0][  0] 36200093  54.A
    LAST[1][ 21] 976000A5 151.B
    LAST[2][  0] 03800083   3.C
    LAST[3][  0] D97000B6 217.B
    LAST[4][  0] D8F000F7 216.D
    LAST[5][  0] 34E00083  52.D
    LAST[6][  0] 4D4000A5  77.B
    LAST[7][  0] A89000B5 168.C
    LAST[8][  0] 171000A2  23.A
    LAST[9][  0] 36200039  54.A
    
This table of recent 10 addresses is managed in the LRU order, that is the entry of the least recentry hit is pushed out from the table.

    <!--#echo var=COUNTER fmt="Hits %T : %mHT/hour, %mdT/day, %mmT/month" -->
    Hits 2848 : 0.1/hour, 2.0/day, 63.5/month

PageViews: 2,558 hits / 213 nets
[ The source of this SHTML file (917 hits) ]