Add starttime to php-fpm metrics (#5997)
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
PF_POOL = "pool"
|
PF_POOL = "pool"
|
||||||
PF_PROCESS_MANAGER = "process manager"
|
PF_PROCESS_MANAGER = "process manager"
|
||||||
|
PF_START_SINCE = "start since"
|
||||||
PF_ACCEPTED_CONN = "accepted conn"
|
PF_ACCEPTED_CONN = "accepted conn"
|
||||||
PF_LISTEN_QUEUE = "listen queue"
|
PF_LISTEN_QUEUE = "listen queue"
|
||||||
PF_MAX_LISTEN_QUEUE = "max listen queue"
|
PF_MAX_LISTEN_QUEUE = "max listen queue"
|
||||||
@@ -242,7 +243,8 @@ func importMetric(r io.Reader, acc telegraf.Accumulator, addr string) (poolStat,
|
|||||||
|
|
||||||
// Start to parse metric for current pool
|
// Start to parse metric for current pool
|
||||||
switch fieldName {
|
switch fieldName {
|
||||||
case PF_ACCEPTED_CONN,
|
case PF_START_SINCE,
|
||||||
|
PF_ACCEPTED_CONN,
|
||||||
PF_LISTEN_QUEUE,
|
PF_LISTEN_QUEUE,
|
||||||
PF_MAX_LISTEN_QUEUE,
|
PF_MAX_LISTEN_QUEUE,
|
||||||
PF_LISTEN_QUEUE_LEN,
|
PF_LISTEN_QUEUE_LEN,
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ func TestPhpFpmGeneratesMetrics_From_Http(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fields := map[string]interface{}{
|
fields := map[string]interface{}{
|
||||||
|
"start_since": int64(1991),
|
||||||
"accepted_conn": int64(3),
|
"accepted_conn": int64(3),
|
||||||
"listen_queue": int64(1),
|
"listen_queue": int64(1),
|
||||||
"max_listen_queue": int64(0),
|
"max_listen_queue": int64(0),
|
||||||
@@ -85,6 +86,7 @@ func TestPhpFpmGeneratesMetrics_From_Fcgi(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fields := map[string]interface{}{
|
fields := map[string]interface{}{
|
||||||
|
"start_since": int64(1991),
|
||||||
"accepted_conn": int64(3),
|
"accepted_conn": int64(3),
|
||||||
"listen_queue": int64(1),
|
"listen_queue": int64(1),
|
||||||
"max_listen_queue": int64(0),
|
"max_listen_queue": int64(0),
|
||||||
@@ -130,6 +132,7 @@ func TestPhpFpmGeneratesMetrics_From_Socket(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fields := map[string]interface{}{
|
fields := map[string]interface{}{
|
||||||
|
"start_since": int64(1991),
|
||||||
"accepted_conn": int64(3),
|
"accepted_conn": int64(3),
|
||||||
"listen_queue": int64(1),
|
"listen_queue": int64(1),
|
||||||
"max_listen_queue": int64(0),
|
"max_listen_queue": int64(0),
|
||||||
@@ -175,6 +178,7 @@ func TestPhpFpmGeneratesMetrics_From_Socket_Custom_Status_Path(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fields := map[string]interface{}{
|
fields := map[string]interface{}{
|
||||||
|
"start_since": int64(1991),
|
||||||
"accepted_conn": int64(3),
|
"accepted_conn": int64(3),
|
||||||
"listen_queue": int64(1),
|
"listen_queue": int64(1),
|
||||||
"max_listen_queue": int64(0),
|
"max_listen_queue": int64(0),
|
||||||
|
|||||||
Reference in New Issue
Block a user