Skip to content

Surface the most recent ping data to site admins

Administrator requested to merge 13956-show-last-ping into main

Created by: flying-robot

Screen Shot 2020-10-02 at 11 52 58 AM

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

Merge request reports

Loading