BILLmanager 5 Documentation

How to re-collect statistics

Problem

There are no statistics for a certain period and you need to re-collect the statistics for that time.

Solution

The statistics are written to the itemstat table and collected by the processing module once a day according to the task in cron. In the processing module's log, running the operation appear as follows:

An example of a log entry
Feb 15 00:20:01 [5977:1] processing INFO RUN with: processing/pmispmgr5 --command stat --module 1
Comments
An example of a log entry
Feb 15 00:20:03 [5977:1] db EXTINFO Query: 'INSERT INTO itemstat(item, statdate, param, value, measure) VALUES (15, '2020-02-14', 'webdomainlimit', '1', 7) ON DUPLICATE KEY UPDATE
param='webdomainlimit', value='1', measure=7'

To re-collect the statistics:

  1. Find the records for the days needed.

    Find records
    select * from itemstat where statdate="2020-02-14";
    Comments to the command


    To find records on a particular service:

    Find records on a particular service
    select * from itemstat where statdate="2020-02-14" and item=15;
    Comments to the command
  2. Delete the found records.

    Delete records
    delete from itemstat where statdate="2020-02-14";
    Comments to the command


    To delete records on a particular service:

    Delete records
    delete from itemstat where statdate="2020-02-14" and item=15;
    Comments to the command
  3. In the laststatdate field of the processingmodule table, set the date for which you want to collect the statistics.

    Shift the date
    update processingmodule set laststatdate="2020-03-18" where id=1;
    Comments to the command
  4. Start statistics collection manually:

    Statistics collection
    /usr/local/mgr5/processing/pmispmgr5 --command stat --module 1
  5. If the statistics are not collected, check the processing module. Most often, the problem with collecting statistics occurs due to errors on the processing module side or due BILLmanager server being unable to access the processing module.