Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2014-11-08 08:36:20 +0300
committerdiosmosis <benaka@piwik.pro>2014-11-08 08:36:20 +0300
commitbc5a8e3ee9fed5a1e50c024feb1f3f415f3dc699 (patch)
treea14d43451d8fd3a7c2852ac61159ac47f83efc77 /core/Plugin/ProcessedMetric.php
parent41f6d051a3c6a4083a807acdea4e681a02f8f9cb (diff)
Document ProcessedMetric class.
Diffstat (limited to 'core/Plugin/ProcessedMetric.php')
-rw-r--r--core/Plugin/ProcessedMetric.php25
1 files changed, 21 insertions, 4 deletions
diff --git a/core/Plugin/ProcessedMetric.php b/core/Plugin/ProcessedMetric.php
index f70cc915d3..b2d563f633 100644
--- a/core/Plugin/ProcessedMetric.php
+++ b/core/Plugin/ProcessedMetric.php
@@ -11,7 +11,10 @@ use Piwik\DataTable;
use Piwik\DataTable\Row;
/**
- * TODO
+ * Base type for processed metrics. A processed metric is a metric that is computed using
+ * one or more other metrics.
+ *
+ * @api
*/
abstract class ProcessedMetric extends Metric
{
@@ -21,17 +24,31 @@ abstract class ProcessedMetric extends Metric
const COMPONENT_SUBNAMESPACE = 'Metrics';
/**
- * TODO
+ * Computes the metric using the values in a {@link Piwik\DataTable\Row}.
+ *
+ * The computed value should be numerical and not formatted in any way. For example, for
+ * a percent value, `0.14` should be returned instead of `"14%"`.
+ *
+ * @return mixed
*/
abstract public function compute(Row $row);
/**
- * TODO
+ * Returns the array of metrics that are necessary for computing this metric. The elements
+ * of the array are metric names.
+ *
+ * @return string[]
*/
abstract public function getDependenctMetrics();
/**
- * TODO
+ * Executed before computing all processed metrics for a report. Implementers can return `false`
+ * to skip computing this metric.
+ *
+ * @param Report $report
+ * @param DataTable $table
+ * @return bool Return `true` to compute the metric for the table, `false` to skip computing
+ * this metric.
*/
public function beforeCompute(Report $report, DataTable $table)
{