Show 50 recent events with size, processing time and status (closes #347)
check / check (push) Successful in 3m53s
check / check (push) Successful in 3m53s
The recent events list on a webhook's page now shows the 50 newest events, each with its time relative to now (the full UTC timestamp on hover), its body size, its processing time and, when the webhook has exactly one HTTP target, that target's last HTTP status, colour-coded. Resubmitted copies are marked, as in the event log. Processing time is how long the event's slowest delivery took, from being queued to its last recorded attempt. It is read from the existing delivery and attempt timestamps, so nothing new is recorded. The body's size is read in SQL, never the body. Deliveries and attempts load in one batched query each, reusing the event log's attempt loader. Model: opus-5-5
This commit is contained in:
@@ -415,16 +415,21 @@ func (h *Handlers) renderSourceDetail(
|
||||
"webhook_id = ?", webhook.ID,
|
||||
).Find(&targets)
|
||||
|
||||
var events []database.Event
|
||||
var events []RecentEventView
|
||||
|
||||
if h.dbMgr.DBExists(webhook.ID) {
|
||||
webhookDB, dbErr := h.dbMgr.GetDB(webhook.ID)
|
||||
if dbErr == nil {
|
||||
webhookDB.Where(
|
||||
"webhook_id = ?", webhook.ID,
|
||||
).Order("created_at DESC").Limit(
|
||||
recentEventLimit,
|
||||
).Find(&events)
|
||||
events, dbErr = h.loadRecentEvents(
|
||||
webhookDB, webhook.ID, singleHTTPTargetID(targets),
|
||||
)
|
||||
}
|
||||
|
||||
if dbErr != nil {
|
||||
h.log.Error(
|
||||
"failed to load recent events",
|
||||
"webhook_id", webhook.ID, "error", dbErr,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user