mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-25 13:46:22 +00:00
Megre pt-agent branch.
This commit is contained in:
0
t/pt-agent/samples/crontab001.in
Normal file
0
t/pt-agent/samples/crontab001.in
Normal file
2
t/pt-agent/samples/crontab001.out
Normal file
2
t/pt-agent/samples/crontab001.out
Normal file
@@ -0,0 +1,2 @@
|
||||
* 8 * * 1,2,3,4,5 pt-agent --run-service query-history
|
||||
* 9 * * 1,2,3,4,5 pt-agent --send-data query-history
|
||||
1
t/pt-agent/samples/crontab002.in
Normal file
1
t/pt-agent/samples/crontab002.in
Normal file
@@ -0,0 +1 @@
|
||||
17 3 * * 1 cmd
|
||||
3
t/pt-agent/samples/crontab002.out
Normal file
3
t/pt-agent/samples/crontab002.out
Normal file
@@ -0,0 +1,3 @@
|
||||
17 3 * * 1 cmd
|
||||
* 8 * * 1,2,3,4,5 pt-agent --run-service query-history
|
||||
* 9 * * 1,2,3,4,5 pt-agent --send-data query-history
|
||||
3
t/pt-agent/samples/crontab003.in
Normal file
3
t/pt-agent/samples/crontab003.in
Normal file
@@ -0,0 +1,3 @@
|
||||
17 3 * * 1 cmd
|
||||
* * * * 1 pt-agent --run-service old-service
|
||||
|
||||
3
t/pt-agent/samples/crontab003.out
Normal file
3
t/pt-agent/samples/crontab003.out
Normal file
@@ -0,0 +1,3 @@
|
||||
17 3 * * 1 cmd
|
||||
* 8 * * 1,2,3,4,5 pt-agent --run-service query-history
|
||||
* 9 * * 1,2,3,4,5 pt-agent --send-data query-history
|
||||
2
t/pt-agent/samples/crontab004.in
Normal file
2
t/pt-agent/samples/crontab004.in
Normal file
@@ -0,0 +1,2 @@
|
||||
1 * * * * pt-agent --run-service foo
|
||||
2 * * * * pt-agent --send-data foo
|
||||
2
t/pt-agent/samples/crontab004.out
Normal file
2
t/pt-agent/samples/crontab004.out
Normal file
@@ -0,0 +1,2 @@
|
||||
* 8 * * 1,2,3,4,5 pt-agent --run-service query-history
|
||||
* 9 * * 1,2,3,4,5 pt-agent --send-data query-history
|
||||
139
t/pt-agent/samples/query-history/data001.json
Normal file
139
t/pt-agent/samples/query-history/data001.json
Normal file
@@ -0,0 +1,139 @@
|
||||
|
||||
{
|
||||
"classes" : [
|
||||
{
|
||||
"attribute" : "fingerprint",
|
||||
"checksum" : "C72BF45D68E35A6E",
|
||||
"distillate" : "SELECT tbl",
|
||||
"example" : {
|
||||
"query" : "SELECT MIN(id),MAX(id) FROM tbl",
|
||||
"ts" : null
|
||||
},
|
||||
"fingerprint" : "select min(id),max(id) from tbl",
|
||||
"metrics" : {
|
||||
"Lock_time" : {
|
||||
"avg" : "0.009453",
|
||||
"max" : "0.009453",
|
||||
"median" : "0.009453",
|
||||
"min" : "0.009453",
|
||||
"pct" : "0.333333",
|
||||
"pct_95" : "0.009453",
|
||||
"stddev" : "0.000000",
|
||||
"sum" : "0.009453"
|
||||
},
|
||||
"Query_length" : {
|
||||
"avg" : "31",
|
||||
"max" : "31",
|
||||
"median" : "31",
|
||||
"min" : "31",
|
||||
"pct" : "0",
|
||||
"pct_95" : "31",
|
||||
"stddev" : "0",
|
||||
"sum" : "31"
|
||||
},
|
||||
"Query_time" : {
|
||||
"avg" : "0.018799",
|
||||
"max" : "0.018799",
|
||||
"median" : "0.018799",
|
||||
"min" : "0.018799",
|
||||
"pct" : "0.333333",
|
||||
"pct_95" : "0.018799",
|
||||
"stddev" : "0.000000",
|
||||
"sum" : "0.018799"
|
||||
},
|
||||
"Rows_examined" : {
|
||||
"avg" : "0",
|
||||
"max" : "0",
|
||||
"median" : "0",
|
||||
"min" : "0",
|
||||
"pct" : "0",
|
||||
"pct_95" : "0",
|
||||
"stddev" : "0",
|
||||
"sum" : "0"
|
||||
},
|
||||
"Rows_sent" : {
|
||||
"avg" : "0",
|
||||
"max" : "0",
|
||||
"median" : "0",
|
||||
"min" : "0",
|
||||
"pct" : "0",
|
||||
"pct_95" : "0",
|
||||
"stddev" : "0",
|
||||
"sum" : "0"
|
||||
},
|
||||
"db" : {
|
||||
"value" : "db2"
|
||||
},
|
||||
"host" : {
|
||||
"value" : ""
|
||||
},
|
||||
"user" : {
|
||||
"value" : "meow"
|
||||
}
|
||||
},
|
||||
"query_count" : 1,
|
||||
"tables" : [
|
||||
{
|
||||
"create" : "SHOW CREATE TABLE `db2`.`tbl`\\G",
|
||||
"status" : "SHOW TABLE STATUS FROM `db2` LIKE 'tbl'\\G"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"global" : {
|
||||
"files" : [
|
||||
{
|
||||
"size" : 656
|
||||
}
|
||||
],
|
||||
"metrics" : {
|
||||
"Lock_time" : {
|
||||
"avg" : "0.003151",
|
||||
"max" : "0.009453",
|
||||
"median" : "0.000000",
|
||||
"min" : "0.000000",
|
||||
"pct_95" : "0.009171",
|
||||
"stddev" : "0.004323",
|
||||
"sum" : "0.009453"
|
||||
},
|
||||
"Query_length" : {
|
||||
"avg" : "24",
|
||||
"max" : "31",
|
||||
"median" : "26",
|
||||
"min" : "14",
|
||||
"pct_95" : "30",
|
||||
"stddev" : "6",
|
||||
"sum" : "72"
|
||||
},
|
||||
"Query_time" : {
|
||||
"avg" : "0.006567",
|
||||
"max" : "0.018799",
|
||||
"median" : "0.000882",
|
||||
"min" : "0.000002",
|
||||
"pct_95" : "0.018157",
|
||||
"stddev" : "0.008359",
|
||||
"sum" : "0.019700"
|
||||
},
|
||||
"Rows_examined" : {
|
||||
"avg" : "0",
|
||||
"max" : "0",
|
||||
"median" : "0",
|
||||
"min" : "0",
|
||||
"pct_95" : "0",
|
||||
"stddev" : "0",
|
||||
"sum" : "0"
|
||||
},
|
||||
"Rows_sent" : {
|
||||
"avg" : "0",
|
||||
"max" : "0",
|
||||
"median" : "0",
|
||||
"min" : "0",
|
||||
"pct_95" : "0",
|
||||
"stddev" : "0",
|
||||
"sum" : "0"
|
||||
}
|
||||
},
|
||||
"query_count" : 3,
|
||||
"unique_query_count" : 3
|
||||
}
|
||||
}
|
||||
153
t/pt-agent/samples/query-history/data001.send
Normal file
153
t/pt-agent/samples/query-history/data001.send
Normal file
@@ -0,0 +1,153 @@
|
||||
--Ym91bmRhcnk
|
||||
Content-Disposition: form-data; name="agent"
|
||||
|
||||
{
|
||||
"hostname" : "prod1",
|
||||
"uuid" : "123"
|
||||
}
|
||||
--Ym91bmRhcnk
|
||||
Content-Disposition: form-data; name="meta"
|
||||
|
||||
|
||||
--Ym91bmRhcnk
|
||||
Content-Disposition: form-data; name="data"
|
||||
|
||||
{
|
||||
"classes" : [
|
||||
{
|
||||
"attribute" : "fingerprint",
|
||||
"checksum" : "C72BF45D68E35A6E",
|
||||
"distillate" : "SELECT tbl",
|
||||
"example" : {
|
||||
"query" : "SELECT MIN(id),MAX(id) FROM tbl",
|
||||
"ts" : null
|
||||
},
|
||||
"fingerprint" : "select min(id),max(id) from tbl",
|
||||
"metrics" : {
|
||||
"Lock_time" : {
|
||||
"avg" : "0.009453",
|
||||
"max" : "0.009453",
|
||||
"median" : "0.009453",
|
||||
"min" : "0.009453",
|
||||
"pct" : "0.333333",
|
||||
"pct_95" : "0.009453",
|
||||
"stddev" : "0.000000",
|
||||
"sum" : "0.009453"
|
||||
},
|
||||
"Query_length" : {
|
||||
"avg" : "31",
|
||||
"max" : "31",
|
||||
"median" : "31",
|
||||
"min" : "31",
|
||||
"pct" : "0",
|
||||
"pct_95" : "31",
|
||||
"stddev" : "0",
|
||||
"sum" : "31"
|
||||
},
|
||||
"Query_time" : {
|
||||
"avg" : "0.018799",
|
||||
"max" : "0.018799",
|
||||
"median" : "0.018799",
|
||||
"min" : "0.018799",
|
||||
"pct" : "0.333333",
|
||||
"pct_95" : "0.018799",
|
||||
"stddev" : "0.000000",
|
||||
"sum" : "0.018799"
|
||||
},
|
||||
"Rows_examined" : {
|
||||
"avg" : "0",
|
||||
"max" : "0",
|
||||
"median" : "0",
|
||||
"min" : "0",
|
||||
"pct" : "0",
|
||||
"pct_95" : "0",
|
||||
"stddev" : "0",
|
||||
"sum" : "0"
|
||||
},
|
||||
"Rows_sent" : {
|
||||
"avg" : "0",
|
||||
"max" : "0",
|
||||
"median" : "0",
|
||||
"min" : "0",
|
||||
"pct" : "0",
|
||||
"pct_95" : "0",
|
||||
"stddev" : "0",
|
||||
"sum" : "0"
|
||||
},
|
||||
"db" : {
|
||||
"value" : "db2"
|
||||
},
|
||||
"host" : {
|
||||
"value" : ""
|
||||
},
|
||||
"user" : {
|
||||
"value" : "meow"
|
||||
}
|
||||
},
|
||||
"query_count" : 1,
|
||||
"tables" : [
|
||||
{
|
||||
"create" : "SHOW CREATE TABLE `db2`.`tbl`\\G",
|
||||
"status" : "SHOW TABLE STATUS FROM `db2` LIKE 'tbl'\\G"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"global" : {
|
||||
"files" : [
|
||||
{
|
||||
"size" : 656
|
||||
}
|
||||
],
|
||||
"metrics" : {
|
||||
"Lock_time" : {
|
||||
"avg" : "0.003151",
|
||||
"max" : "0.009453",
|
||||
"median" : "0.000000",
|
||||
"min" : "0.000000",
|
||||
"pct_95" : "0.009171",
|
||||
"stddev" : "0.004323",
|
||||
"sum" : "0.009453"
|
||||
},
|
||||
"Query_length" : {
|
||||
"avg" : "24",
|
||||
"max" : "31",
|
||||
"median" : "26",
|
||||
"min" : "14",
|
||||
"pct_95" : "30",
|
||||
"stddev" : "6",
|
||||
"sum" : "72"
|
||||
},
|
||||
"Query_time" : {
|
||||
"avg" : "0.006567",
|
||||
"max" : "0.018799",
|
||||
"median" : "0.000882",
|
||||
"min" : "0.000002",
|
||||
"pct_95" : "0.018157",
|
||||
"stddev" : "0.008359",
|
||||
"sum" : "0.019700"
|
||||
},
|
||||
"Rows_examined" : {
|
||||
"avg" : "0",
|
||||
"max" : "0",
|
||||
"median" : "0",
|
||||
"min" : "0",
|
||||
"pct_95" : "0",
|
||||
"stddev" : "0",
|
||||
"sum" : "0"
|
||||
},
|
||||
"Rows_sent" : {
|
||||
"avg" : "0",
|
||||
"max" : "0",
|
||||
"median" : "0",
|
||||
"min" : "0",
|
||||
"pct_95" : "0",
|
||||
"stddev" : "0",
|
||||
"sum" : "0"
|
||||
}
|
||||
},
|
||||
"query_count" : 3,
|
||||
"unique_query_count" : 3
|
||||
}
|
||||
}
|
||||
--Ym91bmRhcnk
|
||||
19
t/pt-agent/samples/service001
Normal file
19
t/pt-agent/samples/service001
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"links" : {
|
||||
"data" : "/query-history/data",
|
||||
"self" : "/query-history"
|
||||
},
|
||||
"name" : "query-history",
|
||||
"run_schedule" : "1 * * * *",
|
||||
"spool_schedule" : "2 * * * *",
|
||||
"tasks" : [
|
||||
{
|
||||
"name" : "query-history",
|
||||
"number" : "0",
|
||||
"options" : "--output json",
|
||||
"output" : "spool",
|
||||
"program" : "pt-query-digest"
|
||||
}
|
||||
],
|
||||
"ts" : 100
|
||||
}
|
||||
19
t/pt-agent/samples/write_services001
Normal file
19
t/pt-agent/samples/write_services001
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"links" : {
|
||||
"data" : "/query-history/data",
|
||||
"self" : "/query-history"
|
||||
},
|
||||
"name" : "query-history",
|
||||
"run_schedule" : "1 * * * *",
|
||||
"spool_schedule" : "2 * * * *",
|
||||
"tasks" : [
|
||||
{
|
||||
"name" : "query-history",
|
||||
"number" : "0",
|
||||
"options" : "--report-format profile slow008.txt",
|
||||
"output" : "spool",
|
||||
"program" : "pt-query-digest"
|
||||
}
|
||||
],
|
||||
"ts" : 100
|
||||
}
|
||||
Reference in New Issue
Block a user