vrk-kpa / ckanext-matomo

GNU Affero General Public License v3.0
3 stars 3 forks source link

AV-1889: Group resources report by organization and change filtering #20

Closed eetumans closed 1 year ago

eetumans commented 1 year ago

https://jira.dvv.fi/browse/AV-1889

Most downloaded resources used to be a list of most downloaded resources throughout the system regardless of whose resources they were. This changes the report to list organizations with most downloaded resources and when an organization is selected lists the corresponding organizations resources and their download counts from most downloaded to least downloaded and adds the possibility to filter with time (week, month, year) instead of the previous 20-50 results limit.

This also quite accidentally fixes another issue on resource read page resource download statistics graph. It was supposed to fetch all the resource downloads for said resource but defaulted to max 30 days which obviously always gave odd numbers.

image

image

PS: Don't mind the conflicting download numbers on org listing vs org's resources listing. They use data from different sources (package_stats vs resource_stats) and while this SHOULD be correct in actual environments I simply tested by adding random data directly into the DB

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 4480831085


Changes Missing Coverage Covered Lines Changed/Added Lines %
ckanext/matomo/reports.py 1 3 33.33%
ckanext/matomo/model.py 5 14 35.71%
<!-- Total: 6 17 35.29% -->
Files with Coverage Reduction New Missed Lines %
ckanext/matomo/model.py 10 41.85%
<!-- Total: 10 -->
Totals Coverage Status
Change from base Build 4415704601: 0.2%
Covered Lines: 497
Relevant Lines: 1300

💛 - Coveralls