Surface the most recent ping data to site admins
Created by: flying-robot
This introduces a LatestPing
method to the event log, which returns the most recently recorded event of type ping
. Additionally, a MockEventLogs
is added to the mock stores, allowing API tests to conveniently adjust persistent storage state.
Here is an example retrieval of a ping event from the log:
localhost sourcegraph@sourcegraph=# select * from event_logs where name = 'ping' limit 1;
┌─────┬──────┬─────┬─────────┬───────────────────┬─────────┬───────────┐
│ id │ name │ url │ user_id │ anonymous_user_id │ source │ argument │
├─────┼──────┼─────┼─────────┼───────────────────┼─────────┼───────────┤
│ 105 │ ping │ │ 0 │ backend │ BACKEND │ {"u": ... │
└─────┴──────┴─────┴─────────┴───────────────────┴─────────┴───────────┘
(1 row)
Time: 2.640 ms
fixes https://github.com/sourcegraph/sourcegraph/issues/13956