Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
corrected response time of duration
Browse files Browse the repository at this point in the history
  • Loading branch information
itzmeanjan committed Apr 17, 2021
1 parent 720f675 commit be6692c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions app/data/response.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package data

import "time"

// Stat - Response to client queries for current mempool state
// to be sent in this form
type Stat struct {
PendingPoolSize uint64 `json:"pendingPoolSize"`
QueuedPoolSize uint64 `json:"queuedPoolSize"`
Uptime string `json:"uptime"`
Processed uint64 `json:"processed"`
LatestBlock uint64 `json:"latestBlock"`
SeenAgo time.Duration `json:"latestSeenAgo"`
NetworkID uint64 `json:"networkID"`
PendingPoolSize uint64 `json:"pendingPoolSize"`
QueuedPoolSize uint64 `json:"queuedPoolSize"`
Uptime string `json:"uptime"`
Processed uint64 `json:"processed"`
LatestBlock uint64 `json:"latestBlock"`
SeenAgo string `json:"latestSeenAgo"`
NetworkID uint64 `json:"networkID"`
}

// Msg - Response message sent to client
Expand Down
2 changes: 1 addition & 1 deletion app/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func Start(ctx context.Context, res *data.Resource) {
Uptime: time.Now().UTC().Sub(res.StartedAt).String(),
Processed: res.Pool.DoneTxCount(),
LatestBlock: latestBlock.Number,
SeenAgo: time.Now().UTC().Sub(latestBlock.At),
SeenAgo: time.Now().UTC().Sub(latestBlock.At).String(),
NetworkID: res.NetworkID,
})

Expand Down

0 comments on commit be6692c

Please sign in to comment.