PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 5.1.0
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v5.1.0
5.12.0 5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / core / Plugin / ProcessedMetric.php
matomo / app / core / Plugin Last commit date
ConsoleCommand 2 years ago Dimension 2 years ago API.php 2 years ago AggregatedMetric.php 2 years ago ArchivedMetric.php 2 years ago Archiver.php 2 years ago Categories.php 2 years ago ComponentFactory.php 2 years ago ComputedMetric.php 2 years ago ConsoleCommand.php 2 years ago Controller.php 2 years ago ControllerAdmin.php 2 years ago Dependency.php 2 years ago LogTablesProvider.php 2 years ago Manager.php 2 years ago Menu.php 2 years ago MetadataLoader.php 2 years ago Metric.php 2 years ago PluginException.php 2 years ago ProcessedMetric.php 2 years ago ReleaseChannels.php 2 years ago Report.php 2 years ago ReportsProvider.php 2 years ago RequestProcessors.php 2 years ago Segment.php 2 years ago SettingsProvider.php 2 years ago Tasks.php 2 years ago ThemeStyles.php 2 years ago ViewDataTable.php 2 years ago Visualization.php 2 years ago WidgetsProvider.php 2 years ago
ProcessedMetric.php
83 lines
1 <?php
2
3 /**
4 * Matomo - free/libre analytics platform
5 *
6 * @link https://matomo.org
7 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8 */
9 namespace Piwik\Plugin;
10
11 use Piwik\DataTable;
12 use Piwik\DataTable\Row;
13 /**
14 * Base type for processed metrics. A processed metric is a metric that is computed using
15 * one or more other metrics.
16 *
17 * @api
18 */
19 abstract class ProcessedMetric extends \Piwik\Plugin\Metric
20 {
21 /**
22 * The sub-namespace name in a plugin where ProcessedMetrics are stored.
23 */
24 public const COMPONENT_SUBNAMESPACE = 'Columns\\Metrics';
25 /**
26 * Computes the metric using the values in a {@link Piwik\DataTable\Row}.
27 *
28 * The computed value should be numerical and not formatted in any way. For example, for
29 * a percent value, `0.14` should be returned instead of `"14%"`.
30 *
31 * @return mixed
32 */
33 public abstract function compute(Row $row);
34 /**
35 * Returns the array of metrics that are necessary for computing this metric. The elements
36 * of the array are metric names.
37 *
38 * @return string[]
39 */
40 public abstract function getDependentMetrics();
41 /**
42 * Returns the array of metrics that are necessary for computing this metric, but should not
43 * be displayed to the user unless explicitly requested. These metrics are intermediate
44 * metrics that are not really valuable to the user. On a request, if showColumns or hideColumns
45 * is not used, they will be removed automatically.
46 *
47 * @return string[]
48 */
49 public function getTemporaryMetrics()
50 {
51 return array();
52 }
53 /**
54 * Executed before computing all processed metrics for a report. Implementers can return `false`
55 * to skip computing this metric.
56 *
57 * @param Report $report
58 * @param DataTable $table
59 * @return bool Return `true` to compute the metric for the table, `false` to skip computing
60 * this metric.
61 */
62 public function beforeCompute($report, DataTable $table)
63 {
64 return true;
65 }
66 /**
67 * @param Row $row
68 * @ignore
69 */
70 public function beforeComputeSubtable(Row $row)
71 {
72 // empty
73 }
74 /**
75 * @param Row $row
76 * @ignore
77 */
78 public function afterComputeSubtable(Row $row)
79 {
80 // empty
81 }
82 }
83