Fetch the initial data when the widget loads, and then update every five
sec after that. Also better indication of uninitialized values.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
There's no reason we should format the data into a string in the
Perfstats module. Let the recipient do what they want with it instead.
As an example, we reduce the precision of the loadavg stats in the
system status widget. 3 digits precision should be more than enough for
this type of status display.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
The total number of queries is not that interesting for performance
measurements, so let's do queries pr/second instead. Adds a timestamp
column to the dataset, which could be useful for other purposes as well
(like making a graph over time etc.)
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
Make some stricter rules for accessing the perfstats module. We only
want to respond to GET request for json data made by a site admin.
This means we also need to pass along the credentials in the request.
Didn't immediately figure out how to do that using `z_fetch_url`, so we
just fall back to using the JavaScript to populate the widget. This
makes it idle for about 5 sec before it gets the first data sample.
I think that's probably OK.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
At least for now, there's no sensible link target, so it's better to not
link anywhere.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
Adds a bit of javascript that requests the performance stats every 5
seconds.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
Moves collecting performance statistics for the system status activity
widget to a separate module. This will make it easier to get the data
from JavaScript or external monitoring tools.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
To allow for inspecting the params used to connect to the database, we
now save the params in the dba_driver object instance as readonly
attributes. An exception is made to the $pass parameter which is set to
protected access, to make it slightly harder to accidentally leak it.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
Returns the number of undelivered messages in the outq.
Instead of having direct database queries at various places in the code,
I thought it would be better to keep them in a more logical place.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
These are all cases where a variable is used where it may possibly be
undefined at the time of use. Typically the var is defined within a
conditional block, but is used outside of that block, or even within
other conditional blocks.
In the common case the variables will most likely be defined, but it is
possible to reach the code where they are used without the variable
being defined.
All issues discovered with PHPStan at level 1.