|
@@ -23,22 +23,29 @@ func makeQueueHandler(rd redriver.Redriver) gin.HandlerFunc {
|
|
|
sess.AddFlash(fmt.Sprintf("Previous info acquired at: %v", time.Now()))
|
|
|
sess.Save()
|
|
|
|
|
|
+ t0 := time.Now()
|
|
|
qi, err := rd.GetQueueInfo(ctx, qName)
|
|
|
if err != nil {
|
|
|
log.Printf("failed getting info for queue %q: %v", qName, err)
|
|
|
c.JSON(http.StatusInternalServerError, nil)
|
|
|
return
|
|
|
}
|
|
|
+ infoLatency := time.Since(t0)
|
|
|
items, err := rd.GetQueueItems(ctx, qName)
|
|
|
if err != nil {
|
|
|
log.Printf("failed getting items for queue %q: %v", qName, err)
|
|
|
c.JSON(http.StatusInternalServerError, nil)
|
|
|
return
|
|
|
}
|
|
|
+ itemsLatency := time.Since(t0) - infoLatency
|
|
|
c.HTML(http.StatusOK, "", map[string]any{
|
|
|
"flashes": flashes,
|
|
|
"info": qi,
|
|
|
"items": items,
|
|
|
+ "latency": map[string]time.Duration{
|
|
|
+ "info": infoLatency,
|
|
|
+ "items": itemsLatency,
|
|
|
+ },
|
|
|
})
|
|
|
}
|
|
|
}
|