dimStat version 1.0
Copyright (c) 2021 Alexey Kuryakin kouriakine@mail.ru
Utility to get DIM information and poll rate statistics.

The dimStat is command line utility to get information about DIM
servers, clients and services, and also to measure statictics on
DIM poll rate, byte rate (per second) and print as sorted table.
This tool can be useful to analyze DIM traffic (for example, who
produce "spam" in DIM network).  It's important for big systems.
This tool also can be used for DIM scripting (bash/cmd/tcl etc),
for example to check DIM DNS/server/service is available online.

Use "dimStat --help" to get help about program usage and options.

Location:
 .\dimStat.txt                      - this notes
 .\bin\dimStat.exe                  - executable
 .\src\util\dimstat.cxx             - main source (all platforms)
 .\Visual\dimStat.sln               - project for Microsoft Visual Studio
 .\Visual\dimStat.vcproj            - project for Microsoft Visual C++ 2005
 .\Visual\resource\dimStat.rc       - resource file (just to add icon)
 .\Visual\resource\dimStat_rc.h     - resource header (to add icon)
 .\Visual\resource\dimStat_rc.ico   - resource icon (for nice view)

Best way to study the utility is to see Examples.

Next Examples assume DIM_DNS_NODE=localhost (just for test).



Example 1. Checking DNS is running.
**********
[C:\..\dim\bin]$ dimStat --running
RUNNING - DNS localhost Version 2029 is ONLINE.

[C:\..\dim\bin]$ dimStat --running --dns blablabla
PID 1428 - Mon Oct 25 13:15:39 2021 - (ERROR) Client Connecting to DIM_DNS@blablabla: Connection refused
STOPPED - DNS blablabla is DEAD.



Example 2. List running DIM servers.
**********
[C:\..\dim\bin]$ dimStat --servers
5 DIM Server(s) found with DNS localhost
==================================================================
Server Number  Task                           Node            PID
------------------------------------------------------------------
Server 1       DIS_DNS                        w10x32-demo-vm  2096
Server 2       DIM_TASK/DEMO/DIM_PING/SERVER  w10x32-demo-vm  5336
Server 3       DEMO                           w10x32-demo-vm  5244
Server 4       ALPHA                          w10x32-demo-vm  2500
Server 5       TEST                           w10x32-demo-vm  5676


Example 3. List running DIM services by name wildcard.
**********
[C:\..\dim\bin]$ dimStat --services DEMO*
37 DIM Service(s) found by Name(s) DEMO* with DNS localhost
=======================================================
Service Number  Name                       Format  Type
-------------------------------------------------------
Service 1       DEMO/DIM_PING/DIM_CMND_10  C       CMD
Service 2       DEMO/VERSION_NUMBER        L       INFO
Service 3       DEMO/SERVICE_LIST          C       INFO
Service 4       DEMO/DIM_PING/DIM_INFO_10  C       INFO
Service 5       DEMO/SIMPLE/CMND/C         C       CMD
Service 6       DEMO/SIMPLE/CMND/D         D       CMD
Service 7       DEMO/SIMPLE/CMND/F         F       CMD
Service 8       DEMO/SIMPLE/CMND/I         I       CMD
Service 9       DEMO/SIMPLE/CMND/S         S       CMD
Service 10      DEMO/SIMPLE/CMND/X         X       CMD
Service 11      DEMO/CLIENT_LIST           C       INFO
Service 12      DEMO/EXIT                  L:1     CMD
Service 13      DEMO/DIM_PING/DIM_INFO_1   C       INFO
Service 14      DEMO/DIM_PING/DIM_INFO_2   C       INFO
etc.



Example 3. List running DIM services by DIM server name.
**********
[C:\..\dim\bin]$ dimStat --serverservices DEMO
17 DIM Service(s) found on Server DEMO with DNS localhost
===================================================
Service Number  Name                   Format  Type
---------------------------------------------------
Service 1       DEMO/SIMPLE/CMND/C     C       CMD
Service 2       DEMO/SIMPLE/CMND/D     D       CMD
Service 3       DEMO/SIMPLE/CMND/F     F       CMD
Service 4       DEMO/SIMPLE/CMND/I     I       CMD
Service 5       DEMO/SIMPLE/CMND/S     S       CMD
Service 6       DEMO/SIMPLE/CMND/X     X       CMD
Service 7       DEMO/SET_EXIT_HANDLER  L:1     CMD
Service 8       DEMO/SERVICE_LIST      C       INFO
Service 9       DEMO/VERSION_NUMBER    L       INFO
Service 10      DEMO/CLIENT_LIST       C       INFO
Service 11      DEMO/SIMPLE/INFO/C     C       INFO
Service 12      DEMO/SIMPLE/INFO/D     D       INFO
Service 13      DEMO/SIMPLE/INFO/F     F       INFO
Service 14      DEMO/SIMPLE/INFO/I     I       INFO
Service 15      DEMO/SIMPLE/INFO/S     S       INFO
Service 16      DEMO/SIMPLE/INFO/X     X       INFO
Service 17      DEMO/EXIT              L:1     CMD



Example 3. List running DIM clients by DIM server name.
**********
[C:\..\dim\bin]$ dimStat --serverclients DEMO
2 DIM Client(s) found on Server DEMO with DNS localhost
===================================
Client Number  PID   Node
-----------------------------------
Client 1       5244  w10x32-demo-vm
Client 2       2500  w10x32-demo-vm



Example 3. Print DIM poll rate statistics.
**********
[C:\..\dim\bin]$ dimStat --stat 5 --services * --loop 0 --top 20 --sort-by-pollrate

2021.10.25-13:25:15 => dimStat loop 1. Time elapsed since start: 6 sec.
dimStat --dns localhost --sort-by-pollrate --stat 5 --loop 0 --top 20 --services *
==================================================================================================================================================
Service Number  Name                                            Format  Rate,Poll/s     Rate,Byte/s     PollCounter           ByteCounter
--------------------------------------------------------------------------------------------------------------------------------------------------
Service -       TOTAL                                           -       362.400         6402.400        1812                  32012
Service 1       TEST/SIMPLE/INFO/C                              C       58.400          4672.000        292                   23360
Service 2       TEST/SIMPLE/INFO/D                              D       58.400          467.200         292                   2336
Service 3       TEST/SIMPLE/INFO/F                              F       58.400          233.600         292                   1168
Service 4       TEST/SIMPLE/INFO/I                              I       58.400          233.600         292                   1168
Service 5       TEST/SIMPLE/INFO/S                              S       58.400          116.800         292                   584
Service 6       TEST/SIMPLE/INFO/X                              X       58.400          467.200         292                   2336
Service 7       ALPHA/SIMPLE/INFO/C                             C       1.000           80.000          5                     400
Service 8       ALPHA/SIMPLE/INFO/D                             D       1.000           8.000           5                     40
Service 9       ALPHA/SIMPLE/INFO/F                             F       1.000           4.000           5                     20
Service 10      ALPHA/SIMPLE/INFO/I                             I       1.000           4.000           5                     20
Service 11      ALPHA/SIMPLE/INFO/S                             S       1.000           2.000           5                     10
Service 12      ALPHA/SIMPLE/INFO/X                             X       1.000           8.000           5                     40
Service 13      DEMO/SIMPLE/INFO/C                              C       1.000           80.000          5                     400
Service 14      DEMO/SIMPLE/INFO/D                              D       1.000           8.000           5                     40
Service 15      DEMO/SIMPLE/INFO/F                              F       1.000           4.000           5                     20
Service 16      DEMO/SIMPLE/INFO/I                              I       1.000           4.000           5                     20
Service 17      DEMO/SIMPLE/INFO/S                              S       1.000           2.000           5                     10
Service 18      DEMO/SIMPLE/INFO/X                              X       1.000           8.000           5                     40
Service 19      ALPHA/CLIENT_LIST                               C       0.000           0.000           0                     0
Service 20      ALPHA/EXIT                                      I:1     0.000           0.000           0                     0


Enjoy!
