Edge Statistics

Overview

This plugin will review the /opt/ardexa/logs area, and calculate how many events per file. If the collection frequency optional argument (--collection_freq) is used, it will also calculate the collection reliability as a percentage. A sample output is as follows;

Table: solar
Source: inverter-01
File: /opt/ardexa/logs/solar/inverter-01/2024-01-18.csv Events: 288 Reliability: 100.0%
File: /opt/ardexa/logs/solar/inverter-01/2024-01-19.csv Events: 288 Reliability: 100.0%
File: /opt/ardexa/logs/solar/inverter-01/2024-01-20.csv Events: 288 Reliability: 100.0%
File: /opt/ardexa/logs/solar/inverter-01/2024-01-21.csv Events: 288 Reliability: 100.0%
File: /opt/ardexa/logs/solar/inverter-01/2024-01-22.csv Events: 288 Reliability: 100.0%
File: /opt/ardexa/logs/solar/inverter-01/2024-01-23.csv Events: 284 Reliability: 98.6%
File: /opt/ardexa/logs/solar/inverter-01/2024-01-23.csv1. Events: 3 Reliability: 1.0%
File: /opt/ardexa/logs/solar/inverter-01/2024-01-24.csv Events: 279 Reliability: 96.9%
File: /opt/ardexa/logs/solar/inverter-01/2024-01-25.csv Events: 288 Reliability: 100.0%
File: /opt/ardexa/logs/solar/inverter-01/2024-01-26.csv Events: 288 Reliability: 100.0%
File: /opt/ardexa/logs/solar/inverter-01/2024-01-27.csv Events: 288 Reliability: 100.0%
File: /opt/ardexa/logs/solar/inverter-01/2024-01-28.csv Events: 288 Reliability: 100.0%
File: /opt/ardexa/logs/solar/inverter-01/latest.csv Events: 42

This request took:  0.012  seconds.

If the optional arguments --table and --source are left blank, then all tables and sources will be counted. The total count of logs in each file does NOT include the header line. If a header line is changed (such as when a plugin is updated to include new variable(s)), then a new date file will be added. An example is the 2024-01-23.csv1 file shown above. These files will be included in the sampling, but are treated as separate date files. As shown in the sample above, Reliability is only calculated when the collection frequency optional argument (--collection_freq) is used, and there is a table and source specified. When using a source, it will be treated as a partial match unless the optional argument --exact_source_match is used.

The statistics are printed in the discover output, and also downloadable via the file link: /opt/ardexa/config/edge-statistics/edge_statistics.csv. This file will be overwritten every time the discover is run. Collection reliability is not calculated for files that are still being used (ie; less than a day old).

Usage

Usage: edge_statistics discover {optional args}

  • Command argument is discover. There are no other command arguments.

  • The optional argument --table. This is a string that is an exact match of the table.

  • The optional argument --source. This is a string that is a partial match of the source, unless the argument --exact_source_match is used.

  • Using the optional argument --exact_source_match tells the program to treat --sourceas an exact match.

  • Using the optional argument --days_ago tells the program to only look back X days. Default is 30 days unless specified. The maximum is 365 days.

  • The optional argument --collection_freq is used to calculate the collection reliability for a table/source pair. The table and source must be specified when using this argument. This is a numeric (integer) value in seconds. The maximum is 86400 seconds. Default is 300 seconds unless specified.