catalyst / moodle-tool_cloudmetrics

Realtime metrics for Moodle
https://moodle.org/plugins/tool_cloudmetrics
GNU General Public License v3.0
0 stars 3 forks source link

Metric settings and config should go through the metric classes. #127

Closed jaypha closed 2 years ago

jaypha commented 2 years ago

Not all metrics will be defined within the tool_cloudmetrics plugin. Metrics defined in other plugins will use their own config namespace. Any getting and setting of configs should be done through the metric classes (derived from metric\base).

In particular:

  1. This should be defined in metric\base. https://github.com/catalyst/moodle-tool_cloudmetrics/blob/d04c2b3ceef133320671dacebb5bfbc367749e0f/classes/metric/lib.php#L35
  2. This should use metric\<metricname>::get_frequency() https://github.com/catalyst/moodle-tool_cloudmetrics/blob/d04c2b3ceef133320671dacebb5bfbc367749e0f/classes/metric/lib.php#L36
  3. Get and set methods for chart period should be added to the metric classes. https://github.com/catalyst/moodle-tool_cloudmetrics/blob/d04c2b3ceef133320671dacebb5bfbc367749e0f/collector/database/chart.php#L49
jaypha commented 2 years ago

On second inspection, the period code is specific to the database collector, and so in the interests of keeping metrics 'collector blind', that code should say within the database collector. So new priorities