M - S t a t v2.1a A statistics generator for DLG BB/OS (c) Phillip Eastham 1993, 1994. ------------------------------------------------------------------------------ What is it? ~~~~~~~~~~~ M-Stat is a statistics generating program. M-Stat will generate several text files which show the users who is best at the different areas of the BBS. Also listed is the percentage of the total each of the top users has attained. The top users values are totalled and both a number and a percentage of the total is included. Why? ~~~~ I had been using DLGTopX for 12 months or so when I logged onto a local BBS and had a look at the statistics program he was running. I thought it was quite nifty so I set about writing something similar. M-Stat is the result. How do I use it? ~~~~~~~~~~~~~~~~ M-Stat requires a configuration file. It also has a lot of command line switches available. Config file: The config file is a standard ASCII text file which contains the path and name of each of the statistic panels produced. No comments or blank lines are allowed. Only the path/name on each line is allowed! An example config is included. The config file should be placed in 'DLGConfig:Master/M-Stat.cfg'. The order is:- *Line 1: Sysop name Line 2: Downloaded KBytes Line 3: Uploaded KBytes Line 4: Uploaded Files Line 5: Downloaded Files Line 6: Messages written Line 7: Messages read Line 8: Calls Line 9: On-line time Line 10: Chatters Line 11: Best file ratio Line 12: Worst ratio Line 13: User averages #Line 14: Call history Line 15: Usage graph Line 16: Hourly calls graph Line 17: Characters to use in the usage graph. (See below) @Line 18: Free upload credit offset * To cater for Co-Sysops, I now use an in string function. If the current users name is found in this string, it is assumed they are a Co-Sysop. @ I give a default 3K credit to my users so they can download some things before having to upload. The value in this line will be subtracted from the users bytes uploaded value. If the resulting value is negative, 0 is used instead. # This file produces a report of all users, in alphabetical order, listing their last call date, days since that call, total calls, and calls/week. It can only be produced along with the regular stats panels with the -H switch. NOTE: The config MUST have 18 lines. If the program returns an 'end of file' error, edit the file and make sure that each line is terminated with a LF. Switches: These are the switches available:- -A Turn OFF ANSI colors. -B Turn on the horizontal bar's for the usage graph. + -C Turn on Chatters mode. -E Inform user they are on top via 'Event.log' -H Turn on last calls graph, -I DO NOT use IBM extended characters. -Lxx Use xx records instead of 10. Maximum of 99. -K Turn on logging. Will write to DLGConfig:Master/M-Stat.LOG -M Use alias's instead of real names. -P Do NOT produce stats panels. Use to just produce usage graph. -R Place a '%RETURN' at the end of each file. -S Include sysop in statistics. Name taken from config. -Txx Set number of lines to use for usage display. -U Generate Usage graph -V Be verbose. Completely silent otherwise unless a program error occurs. -Z Use different config. You MUST specify the complete path/filename. NO SPACES ARE ALLOWED! Defaults to DLGConfig:Master/M-Stat.cfg -? A short help screen. Do NOT put spaces between a switch and its parameter. Eg: '-L 25' will not work. It has to be '-L25'. + The chat file will be produced regardless of this switch. This switch toggles event log reporting of top chatter and the chatter line in the user averages panel. Place the command in your midnight event script, or run it several times a day via TpTCron. You will then need to set up a menu item for each stats panel. Use the DLG supplied 'DF' command to display the text file. A menu entry would look like this: [ 1] Letter: D [ 2] Executable: (path/name) DLG:DF DLGConfig:Text/TopFDn.TXT [ 4] Description: Worst file downloaders [ 5] Type: Executable [ 6] Help File: STATS/D [ 7] Lower level: 1 [ 8] Upper level: 255 [ 9] Hidden: NO [10] Load type: OVERLAY [11] Ask user if sure: NO [12] Pend messages: YES [13] Cli mode: NO [14] Pause on completion YES Or you can use the inclosed prepaired M-Stat.menun file. It will display all the panels and the usage graph generated by M-Stat's default config file. All you need to do is change the sysop name in the config. A note about the usage and hourly graphs: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It is best to run the usage graph section of M-Stat just before midnight. If you run it just after midnight, chances are the current day will be empty. The usage graph allows the sysop to select a 2 character wide representation for each of the 4 catagories. Either leave this blank or include 8 characters. If its left blank, a double ANSI solid block (IBM) or a double # character will be used. See the config for an example. When a value close to the minimum value is found, a half height ANSI block will be used instead of the defined sysop character. The hourly calls graph shows what percentage of calls are made in the given hour. Its not a usage graph as such because if 5 people log on and use 5 minutes each, the same result will be shown if 5 people log on and use 10 minutes each. Other files accessed: ~~~~~~~~~~~~~~~~~~~~~ M-Stat requires several files in order to run. First is the file DLGConfig:Misc/Users.BBS. The program will exit if this file doesn't exist. M-Stat then reads in each users data file. The filenames stored in the config file are not checked for existance. Make sure the path you give exists! The 7 log files contained in DLGConfig:Text/ are also needed for usage graph production. If a file is not present, it will be skipped. DLG.Library V2.0 is now required for M-Stat to run. Program status: ~~~~~~~~~~~~~~~ M-Stat has matured into shareware. It is not crippled in any way though. If you have registered any of my other programs, then you can have this one on me! Registration is $10. Any bug reports or suggestions for improvements can be sent to me via Fido or UUCP: FidoNET: Phillip Eastham@3:622/406 InterNET: phillip_eastham@kumear.apana.org.au History: ~~~~~~~~ Version 1.0 - Initial release. Version 1.1 - Made byte values dynamic to each system. Will switch between Bytes, KBytes, and MBytes depending on how many bytes the top user has accumulated. - Adjusted output so the graph was a little wider. - Streamlined operations a little. Version 1.2 - Fixed a problem when there are no more users with non-zero values. Now the entire line is just left blank. - Streamlined operations a little more! - Changed several error-trapping routines. - Added error output to sysop's 'Event.log' file. Version 1.3 - Added usage graph generation. - Made number of records totally sysop settable. - Changed formatting a little. Version 1.3a - Fixed a problem with incorrect ANSI on usage graph when stats panels not generated. - Fixed a bug in detection of Sysop in stats generation. - Made total for top users in byte down/uploads conform to 2 decimal places if there is room. - Added a bit more verbosity when turned on. Version 1.3b - Fixed a problem with the message bar of usage graph using the upload bar's characters for custom bar's. - Added the -B option to make the usage graph more customisable. Version 1.3c - Implemented some library calls. Version 1.3d - Fixed a problem with event.log recording. - Cleaned up some routines. - Fixed a problem that was causing a RAM leak. - Changed the usage graph just a little. Version 1.4 - Added top chatters with limited disabling. - Added Co-Sysop support. - Changed average values to Integers for those panels where you can't have fractions. - Removed error reporting to sysop's event.log because of the Co-Sysop support. Now appends error messages to a global error file called 'LOGS:M-Error.log'. Version 1.4a - Fixed a major problem with system crashes and freezes under OS3.1. Host machine was an A3000. Apparantly fixed in a test version sent to system. Version 1.5 - Fixed a divide by zero error when only sysop on system and sysop stats not used. - Removed -N switch. Found the cause of the failing ANSI line clear code. Now works properly. Version 1.6 - Added -A switch. - Added -M switch. - Added -Z switch. - Fixed top line problem. Now is correct length. Version 1.7 - Added -I switch. - Added ratio panels. Version 1.8 - Added hourly percentage calls. - Appears like the long standing mysterious bug which caused system hanging has been cured. Version 1.9 - Fixed a problem with worst file ratio event writing. Version 2.0 - Added call history graph. - Included memory patch file. Version 2.1 - Hopefully fixed the 'String to long' error. - Added logfile option. - Set maximum of 99 records in each of the stats panels. Version 2.1a - Fixed bug in caller history panel. Now puts in name. Thanks to: ~~~~~~~~~~ Thanks go to Mike West for testing the program on a sparsely populated BBS. Thanks to the Eric De Jong for the ARexx script from which the usage graph is taken. Thanks go to the OS3.1 owner who shall remain nameless (for obvious reasons!).