From 47c7faf8378c2b56736157b0867b4618ea62be9b Mon Sep 17 00:00:00 2001 From: Justin Li Date: Thu, 24 Jul 2014 19:36:57 -0400 Subject: [PATCH] Reorder stats output --- stats/stats.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/stats/stats.go b/stats/stats.go index 32442af..f3d2826 100644 --- a/stats/stats.go +++ b/stats/stats.go @@ -66,16 +66,6 @@ type PercentileTimes struct { type Stats struct { Started time.Time // Time at which Chihaya was booted. - Announces uint64 `json:"Tracker.Announces"` // Total number of announces. - Scrapes uint64 `json:"Tracker.Scrapes"` // Total number of scrapes. - - IPv4Peers PeerStats `json:"Peers.IPv4"` - IPv6Peers PeerStats `json:"Peers.IPv6"` - - TorrentsAdded uint64 `json:"Torrents.Added"` - TorrentsRemoved uint64 `json:"Torrents.Removed"` - TorrentsReaped uint64 `json:"Torrents.Reaped"` - OpenConnections uint64 `json:"Connections.Open"` ConnectionsAccepted uint64 `json:"Connections.Accepted"` BytesTransmitted uint64 `json:"BytesTransmitted"` @@ -83,9 +73,19 @@ type Stats struct { RequestsHandled uint64 `json:"Requests.Handled"` RequestsErrored uint64 `json:"Requests.Errored"` ClientErrors uint64 `json:"Requests.Bad"` + ResponseTime PercentileTimes - ResponseTime PercentileTimes - MemStats *MemStatsWrapper `json:"Memory,omitempty"` + Announces uint64 `json:"Tracker.Announces"` + Scrapes uint64 `json:"Tracker.Scrapes"` + + TorrentsAdded uint64 `json:"Torrents.Added"` + TorrentsRemoved uint64 `json:"Torrents.Removed"` + TorrentsReaped uint64 `json:"Torrents.Reaped"` + + IPv4Peers PeerStats `json:"Peers.IPv4"` + IPv6Peers PeerStats `json:"Peers.IPv6"` + + MemStats *MemStatsWrapper `json:"Memory,omitempty"` events chan int ipv4PeerEvents chan int