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

Fetch report metadata and metrics site by site, if multiple sites are given in API.get #16347

Closed
wants to merge 1 commit into from

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Aug 26, 2020

Fetch report metadata or reports with idSites=all might result in an error as some plugins do not support it.
Fetching all reports and metadata site by site instead fixes that.

@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review labels Aug 26, 2020
@diosmosis
Copy link
Member

Doesn't this multiply the number of archive queries by number of sites?

@sgiehl
Copy link
Member Author

sgiehl commented Aug 26, 2020

That might be possible. Not sure if all archives are fetched with one query if idSites=all is given to an API method...
But it at least includes all reports. Fetching the report metadata with idSites=all excludes various reports as they don't support it.

@diosmosis
Copy link
Member

diosmosis commented Aug 26, 2020

That might be possible. Not sure if all archives are fetched with one query if idSites=all is given to an API method...

If multiple idSites are given to Archive::get(, it should be just one query using idsite IN (. Otherwise, it's a couple queries per idSite.

@sgiehl
Copy link
Member Author

sgiehl commented Aug 26, 2020

Ok. Alternatively we would need to make all API methods and reports metadata compatible with multiple idSites. Tried catching errors in the first place instead of iterating through the sites, but that removes a lot of metrics, as the reports aren't available for multiple sites...

@tsteur tsteur added this to the Backlog (Help wanted) milestone Aug 26, 2020
@tsteur
Copy link
Member

tsteur commented Aug 26, 2020

@sgiehl @diosmosis we won't be fixing this for now I reckon as it's not a priority and we'll need to see re performance impact etc. Also the API call to getREportMetadata would need to be executed through Request::processRequest potentially etc re segments/dimensions and other things that might be site specific. If we continue to support this feature then we'd likely would need to fix this maybe in the plugins itself or so.

@tsteur tsteur marked this pull request as draft August 26, 2020 20:05
@tsteur
Copy link
Member

tsteur commented Aug 26, 2020

fyi documented this for now in matomo-org/developer-documentation#377

@tsteur
Copy link
Member

tsteur commented Sep 2, 2020

I've created an issue for now in #16366 and we'll schedule this work eventually to see if other APIs are impacted too and what a proper fix be should we keep this feature. I'll close the PR for now but we might reopen it again later.

@tsteur tsteur closed this Sep 2, 2020
@mattab mattab modified the milestones: Backlog (Help wanted), 4.0.0 Sep 28, 2020
@sgiehl sgiehl deleted the apiget branch January 9, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants