Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics should be defined by metadata classes like Reports/Dimensions/Segments #6262

Closed
diosmosis opened this issue Sep 21, 2014 · 0 comments
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. duplicate For issues that already existed in our issue tracker and were reported previously. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.

Comments

@diosmosis
Copy link
Member

Normal metrics (like 'nb_visits', 'nb_hits', etc.) should be defined in their own classes like Reports/Dimensions/Segments are. For example:

class Visits
{
    protected function init()
    {
        $this->id = 'nb_visits';
        $this->entityTable = 'log_visit';
    }

    public function aggregate($lhs, $rhs)
    {
        return $lhs + $rhs;
    }

    public function aggregateSql()
    {
        return "COUNT(*)";
    }
}

Care should be taken to consider non-relational databases. If possible, changes should be futureproof.

@diosmosis diosmosis added Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. labels Sep 21, 2014
@mattab mattab added this to the Short term milestone Sep 25, 2014
@mattab mattab modified the milestones: Mid term, Short term Nov 10, 2014
@mattab mattab modified the milestones: 3.0.0, Long term May 6, 2016
@mattab mattab closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2023
@sgiehl sgiehl added the duplicate For issues that already existed in our issue tracker and were reported previously. label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. duplicate For issues that already existed in our issue tracker and were reported previously. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

3 participants