Skip to content

Commit

Permalink
Fixed issue where queue depth did not report
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevenson Jean-Pierre committed Jun 16, 2015
1 parent 9a78a9b commit da703d8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type passengerStatus struct {
ProcessCount int `xml:"process_count"`
PoolMax int `xml:"max"`
PoolCurrent int `xml:"capacity_used"`
QueuedCount int `xml:"get_wait_list_size"`
QueuedCount []int `xml:"supergroups>supergroup>group>get_wait_list_size"`
Processes []process `xml:"supergroups>supergroup>group>processes>process"`
}

Expand All @@ -34,6 +34,7 @@ type process struct {
Memory int `xml:"real_memory"`
}


//Stats is used to store stats
type Stats struct {
min int
Expand Down Expand Up @@ -113,11 +114,15 @@ func processUptime(passengerDetails *passengerStatus) Stats {
}

func chartPendingRequest(passengerDetails *passengerStatus, DogStatsD *godspeed.Godspeed) {
if print {
var totalQueued int
for _,queued := range passengerDetails.QueuedCount {
totalQueued += queued
}
if print {
fmt.Println("|=====Queue Depth====|")
fmt.Println("Queue Depth", passengerDetails.QueuedCount)
fmt.Println("Queue Depth", totalQueued)
}
DogStatsD.Gauge("passenger.queue.depth", floatMyInt(passengerDetails.QueuedCount),nil)
DogStatsD.Gauge("passenger.queue.depth", floatMyInt(totalQueued),nil)
}
func chartPoolUse(passengerDetails *passengerStatus, DogStatsD *godspeed.Godspeed) {
if print {
Expand Down

0 comments on commit da703d8

Please sign in to comment.