Jump to: navigation, search

Metric statistics

Use the script, statistic.py to collect statistics about the enabled BDS metrics, including details about what data was processed, the number of events, event peak times, and message sizes for each metric, for a day or range of days that you can specify. The script gathers information from transform files, and saves it into CSV output files in a local directory; a configuration parameter allows you to specify the output directory. In multi-tenant environments, the script distinguishes between individual tenants / resellers, generating separate output files for each one. The script is available in release 9.0.000.33 and later.

How the script works

The script is available in the brs/bds_statistic directory, and accepts the following syntax:

statistic.py [-t <tenant/reseller>] [-sd <start date>] [-ed <end date>]

where:

  • -t is a list of tenant or resellers on which to report, for example, -t Tenant1 Tenant2 Reseller1. If no value is specified, the script gathers data for all available tenants and resellers.
  • -sd is the start date (YYYY-MM-DD), representing the first day from which to gather statistics. For example, -sd 2020-02-01. If no value is specified, the script uses the transform watermark minus one day.
  • -ed is the end date (YYYY-MM-DD) representing the last day from which to gather statistics. For example, -ed 2020-02-08. If no value is specified, the script uses the transform watermark.

For example:

[vagrant@ef04ae121e57 vagrant]$ python /vagrant/brs/bds_statistic/statistic.py -t Tenant1 Tenant2 Reseller1 -sd 2020-02-01 -ed 2020-02-08

The script uses the directories described in the following table:

Directory Path Description
transform globals/premise/local_cache/transform The local directory where the script looks for transform files generated by BDS. Configure the globals/premise/local_cache/transform parameter to specify the location of this directory.
statistic_tenant
  • gvars.statistic_result_dir/<tenant> (for statistic results)
  • gvars.statistic_result_dir/<tenant>/statistic.log (for log files)
The local directory where files generated by the metric statistic script are stored (one file for each tenant). Configure the statistic_log_file and statistic_result_dir parameters (in gvars.py) to specify this path.

Resulting data files

The script generates a dated file for each tenant / reseller, in /vagrant/log/ statistic/tenant, for example:

  • /vagrant/log/statistic/tenant/Tenant1/2020-02-02.csv
  • /vagrant/log/statistic/tenant/Tenant2/2020-02-02.csv
  • /vagrant/log/statistic/tenant/Reseller1/2020-02-02.csv

Sample output in the tenant folder: Sample tenant output

This page was last edited on January 22, 2020, at 18:07.

Feedback

Comment on this article:

blog comments powered by Disqus