mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-22 03:37:43 +00:00
latency is a positive value
This commit is contained in:
parent
5095b78681
commit
c346b728fc
1 changed files with 1 additions and 1 deletions
|
@ -103,7 +103,7 @@ func accountWorker(id int, rc *reddit.Client, db *sql.DB, logger *log.Logger, st
|
||||||
// Set latest message we alerted on
|
// Set latest message we alerted on
|
||||||
latestMsg := msgs.MessageListing.Messages[0]
|
latestMsg := msgs.MessageListing.Messages[0]
|
||||||
|
|
||||||
latency := latestMsg.CreatedAt - float64(now)
|
latency := float64(now) - latestMsg.CreatedAt
|
||||||
statsd.Histogram("apollo.notification.latency", latency, []string{}, rate)
|
statsd.Histogram("apollo.notification.latency", latency, []string{}, rate)
|
||||||
|
|
||||||
_, err = tx.Exec(`UPDATE accounts SET last_message_id = $1 WHERE id = $2`, latestMsg.FullName(), account.ID)
|
_, err = tx.Exec(`UPDATE accounts SET last_message_id = $1 WHERE id = $2`, latestMsg.FullName(), account.ID)
|
||||||
|
|
Loading…
Reference in a new issue