@diosmosis opened this Issue on September 21st 2014 Member

Processed metrics should be described as Reports/Dimensions/Segments currently are. That is there should be a class w/ metadata & related methods for each processed metric. For example,

class AvgTimeOnSite extends ProcessedMetrics
{
    public function calculate(Row $row) { ... }

    public function format($value) { ... }
}

Instead of using queued filters to calculate and format processed metrics, the list of processed metrics should be added to DataTable metadata. Then in ResponseBuilder a filter should be used to calculate all data. Then for non-'original' API renderers, a filter should be executed that formats columns.

This will avoid all future occurrences of the 'trying to add string + string' error in DataTable\Row::sumRow and will make it easier to manipulate tables since there will be less queued filters to worry about.

When finished, make sure to remove the clearQueuedFilters() call in PivotByDimension.php.

@mattab commented on October 22nd 2014 Owner

Moved this issue into current milestone as it's become important.

@diosmosis your refactor work in this issue should solve #6485 which is a bug that has re-appeared and it's major priority as it breaks Scheduled Reports (eg. on our demo)

@mattab commented on November 11th 2014 Owner

Moving to 2.10.0 as we can plan the refactor more broadly and revisit how processed metrics are handled in visualisations and plugins. see also Processed metrics metadata pull request #6589

This Issue was closed on November 27th 2014
Powered by GitHub Issue Mirror