-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathprocess.go
33 lines (30 loc) · 974 Bytes
/
process.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
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 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"
ReadingHeaders = "Reading headers"
)