-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic support for processes reading headers.
- Loading branch information
Anders Brander
committed
Sep 26, 2016
1 parent
6bd5983
commit 589e35d
Showing
2 changed files
with
31 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
package main | ||
|
||
import "time" | ||
import ( | ||
"encoding/json" | ||
"time" | ||
) | ||
|
||
type ( | ||
process struct { | ||
Pid int `json:"pid"` | ||
LastRequestCPU float64 `json:"last request cpu"` | ||
LastRequestMemory int `json:"last request memory"` | ||
State string `json:"state"` | ||
User string `json:"user"` | ||
ContentLength int `json:"content length"` | ||
RequestURI string `json:"request uri"` | ||
RequestDuration int `json:"request duration"` | ||
Requests int `json:"requests"` | ||
StartSince int `json:"start since"` | ||
StartTime time.Time `json:"start time_FIXME"` | ||
Script string `json:"script"` | ||
RequestMethod string `json:"request method"` | ||
Pid int `json:"pid"` | ||
LastRequestCPU float64 `json:"last request cpu"` | ||
LastRequestMemory int `json:"last request memory"` | ||
State string `json:"state"` | ||
User string `json:"user"` | ||
ContentLength int `json:"content length"` | ||
RequestURI string `json:"request uri"` | ||
// RequestDuration will be bigger than 2^64 when the PHP process is | ||
// reading headers, we have to use json.Number here. | ||
RequestDuration json.Number `json:"request duration"` | ||
Requests int `json:"requests"` | ||
StartSince int `json:"start since"` | ||
StartTime time.Time `json:"start time_FIXME"` | ||
Script string `json:"script"` | ||
RequestMethod string `json:"request method"` | ||
} | ||
) | ||
|
||
// Process states. | ||
const ( | ||
Running = "Running" | ||
Idle = "Idle" | ||
Running = "Running" | ||
Idle = "Idle" | ||
ReadingHeaders = "Reading headers" | ||
) |