Problem/Motivation
Sometimes user's may want to know when certain KPIs fall outside of an expected range (e.g. If fully loaded page time takes longer than 8 seconds, send an email or whatever).
Proposed resolution
After #3072581: Configurable KPIs is completed, add configurable thresholds to the performance_budget_kpi_group config entities. And then when a capture is performed broadcast a custom event, the other modules can subscribe to.
Accessible Scanner also needs the means for notifications (See #3043963: Notification System). As such, we could maybe combine some of the need there by adding the notification functionality into the Web Page Archive module itself. It would make sense for that module to handle all of the notification events/subscribers and then performance budget could just trigger the event.
Remaining tasks
TBD
User interface changes
TBD
API changes
TBD
Data model changes
TBD
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | interdiff-9-11.txt | 730 bytes | WidgetsBurritos |
| #11 | 3074048-configurable-thresholds-11.patch | 36.08 KB | WidgetsBurritos |
Comments
Comment #2
WidgetsBurritos commentedUnblocking this task as the dependency is complete.
Comment #3
WidgetsBurritos commentedBlocked on #3074051: Notification System
Comment #4
WidgetsBurritos commentedThis is dependent on WIP in #3074051: Notification System. Merely posting this as a POC. This doesn't have the threshold monitoring yet, but does have the email alerts setup. You simply use this template:
That all seems to be working as expected. So basically we just need to generate a new context that happens when thresholds are met, and then send email.
Comment #5
WidgetsBurritos commentedOkay, this is still dependent on #3074051: Notification System going in, but this basically has everything we want in it. The only caveat is we don't have great test coverage around the actual capturing functionality. In the functional test, we "simulate" it. I probably need a way to mock that service in the future, but for now, I think this is fine to consider moving forward.
Although we may want to set a minimum module compatibility version or something once WPA is updated.
Comment #7
WidgetsBurritos commentedPer review session with @vessel_adrift:
Change these all back to integer
probably should be
Because the minimum could feasibly be set to the value of zero. None of the metrics that I know of can return negative values, but I don't want to be surprised by this in the future.
Same with the maximu
Should be isset instead of !empty in case value is zero.
We are no longer using the messenger service here. We can kill this.
We don't need this refactor here after all as we're not using $kpis in this method.
Could $actual ever be zero here?
Also $kpi_details['minimum'] could also be zero?
This should check for the existence of #threshold_violations as it's not always set, if there are none.
For now I don't care about violations cumulatively. We may in a future task, and should create an issue for that specific context if we do.
Comment #8
WidgetsBurritos commentedItems #7.1 - #7.7 have been addressed.
#7.8 is more of a commentary than anything. We can potentially add another ticket for this later.
Comment #9
WidgetsBurritos commentedMinor formatting change.
Comment #10
vessel_adrift commented+1 rtbc
Comment #11
WidgetsBurritos commentedOkay now that WPA is merged and the version is bumped, changing the version of WPA we look at here.
Comment #12
WidgetsBurritos commentedAt some point this will need to change to an actual release. This is just temporary at this point.
Comment #15
WidgetsBurritos commentedOkay confirmed tests are passing as expected with new versions. Going to go ahead and create a new alpha release. Before we can move this module to beta, we'll need to get WPA 3.0 release launched.
Comment #17
WidgetsBurritos commented