Use LogAggregator and ArchiveProcessor

Hello

I would like to do some benchmarking with Piwik - in particular with the LogAggregator and ArchiveProcessor. How can I instantiate these in my plugin? I’ve attempted to implement an Archiver which extends \Piwik\Plugin\Archiver - but I don’t know how to instantiate it.

Many thanks!

It is automatically instantiated during the archiving process.

If you want to do some tests, then please consider writing some unit tests (see examples in CustomAlerts plugin)

btw: there is a command to generate tests for the plugin: ./console generate:test PluginNameHere

if we can help, let us know!

Do you all have any example to archive a new metric? I’m trying to read the online docs, but I’m not seeing any examples for just metrics.

To be more specific, I’m looking for examples on how to calculate the metric. While I was reading Data Model: DevelopInDepth - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3, I found this code “$myFancyMetric = // … calculate the metric value …” under Report & Metric Caching heading.

Where can I find an example to calculate my metric value that will account for segments that are selected?

Thank you for your time,