We were discussing how to add a project fact that tracks the number of recent restarts as an indicator of quality recently. It would be trivial to implement if we had a way to periodically run
SELECT COUNT(o.id)
FROM v1.operations_log AS o
WHERE o.project_id = %(project_id)s
AND o.change_type = 'Restarted'
AND o.recorded_at > CURRENT_TIMESTAMP - INTERVAL '14d'
and assign the value to the Recent Restart Count fact.
This shouldn't be too difficult to implement... without thinking too hard about it:
add a new fact type named query -- current values are enum, range, & free-form
create v1.project_fact_types_query to hold the query and frequency
add a periodic task somewhere that runs queries for projects with a "query" fact type -- pgcron?
We were discussing how to add a project fact that tracks the number of recent restarts as an indicator of quality recently. It would be trivial to implement if we had a way to periodically run
and assign the value to the
Recent Restart Count
fact.This shouldn't be too difficult to implement... without thinking too hard about it:
query
-- current values are enum, range, & free-formv1.project_fact_types_query
to hold the query and frequency