DevDavido / performance-audit-plugin

Daily performance audits of all your sites in Matomo.
GNU General Public License v3.0
12 stars 4 forks source link

Audit's report are created but never commit to database #37

Closed Aguay-val closed 3 years ago

Aguay-val commented 3 years ago

Hi

I'm using PerformanceAudit since a while now but I was never able to commit data to the database. I'm facing several "problems" which might be interesting to discuss with you, and maybe, help you to add those functionality. I'm not a developper but I could help in some way maybe !

Let me explain :) !

  1. I have 2016 urls scanned by PerformanceAudit (Number of uniq id from "Audit" folder).

I don't really know how to determine which url has been scanned. Is there any way to control which url will be "available" to PerformanceAudit ? While reading the code i could understand that it takes all url from last 30days right ? Can we configure, for example, "run audit for last 7 days urls only" ? This might be interesting ?

  1. Many times i have this error in my logs :
Audit of https://mywebsite/withmyarticle failed: Runtime error encountered: Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Details: net::ERR_INSUFFICIENT_RESOURCES

I'm not sure what to do. And i can't see any "errors" in PerformanceAudit plugins. Is there any way to retrieve those errors and be able to "notify" someone if failed ?

  1. Because it works but i don't have reports commited to the database. Is there any way to manually run the job to read all json and send them to the database ?

Bonus question, do you think it's possible to add button close to a "pages" from "pages" view of Matomo to trigger a "single" scan ?

Thanks for your awesome work so far.

DevDavido commented 3 years ago

Thank you @Aguay-val for your detailed and nice feedback. Currently I don't have time to look into those issues in detail unfortunately. It seems though that the underlying Lighthouse can't perform the audit itself (due to insufficient host resources, too complex website, connection certificate issue or some other reason) and that causes the subsequent errors.

A few questions though so I can look into your...

Point 1:

control which url will be "available"

That's currently not possible, but there's opportunity to create a URL filter mechanism in the site settings.

that it takes all url from last 30days right?

Yes.

Point 2: What are the hardware specs of the server the plugin is running on? Any hard limits on useable resources? Are you ok to share one of the URLs of the failed audit?

Is there any way to retrieve those errors and be able to "notify" someone if failed?

Currently not by the plugin, but it's possible to create a script to scan the logs for those errors and notify someone in case of failure.

Point 3: It doesn't commit to the database due to the failed audits (see point 2).

do you think it's possible to add button close to a "pages" from "pages" view of Matomo to trigger a "single" scan?

That's totally possible, however it would need some work on the plugin to make that happen.

Feel free to create a PR for any of the points after discussing the details. 👍

Aguay-val commented 3 years ago

Screw it ! I forgot to answer !

Hardware spec:

8vcpu (using Qemu virtualization) and 16Gigs of ram. On top of SSD ( in case you were wondering). I could share one of url ( in PM if you are ok with)

I'll try to work on my free time to bring some features :)

Thanks !

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Thank you for your contributions.