/api/stats/query

该端点可用于跟踪和疑难解答针对 TSD 执行的查询。它维护着一个无限制的当前正在执行的查询列表,以及一个多达 256 个已完成查询的列表(将最旧的查询从内存中移出)。有关每个查询的信息包括原始查询,请求 Headers,响应代码,时间安排和抛出异常。 (v2.2)

Verbs

  • GET

Requests

无可用参数。

Example Request

Query String

http://localhost:4242/api/stats/query

Response

响应包括两个数组。 completed列出成功完成或出错的 256 条最近执行完毕的查询。 running数组包含当前正在执行的查询的列表。如果此列表不断增加,则 TSD 负担沉重。请注意,运行列表将不包含异常,响应代码或时序详细信息。

有关统计信息端点的各个部分和数据的信息,请参阅查询详细信息和统计信息

Example Response

{
      "completed": [{
              "query": {
                      "start": "1455531250181",
                      "end": null,
                      "timezone": null,
                      "options": null,
                      "padding": false,
                      "queries": [{
                              "aggregator": "zimsum",
                              "metric": "tsd.connectionmgr.bytes.written",
                              "tsuids": null,
                              "downsample": "1m-avg",
                              "rate": true,
                              "filters": [{
                                      "tagk": "colo",
                                      "filter": "*",
                                      "group_by": true,
                                      "type": "wildcard"
                              }, {
                                      "tagk": "env",
                                      "filter": "prod",
                                      "group_by": true,
                                      "type": "literal_or"
                              }, {
                                      "tagk": "role",
                                      "filter": "frontend",
                                      "group_by": true,
                                      "type": "literal_or"
                              }],
                              "rateOptions": {
                                      "counter": true,
                                      "counterMax": 9223372036854775807,
                                      "resetValue": 1,
                                      "dropResets": false
                              },
                              "tags": {
                                      "role": "literal_or(frontend)",
                                      "env": "literal_or(prod)",
                                      "colo": "wildcard(*)"
                              }
                      }, {
                              "aggregator": "zimsum",
                              "metric": "tsd.hbase.rpcs.cumulative_bytes_received",
                              "tsuids": null,
                              "downsample": "1m-avg",
                              "rate": true,
                              "filters": [{
                                      "tagk": "colo",
                                      "filter": "*",
                                      "group_by": true,
                                      "type": "wildcard"
                              }, {
                                      "tagk": "env",
                                      "filter": "prod",
                                      "group_by": true,
                                      "type": "literal_or"
                              }, {
                                      "tagk": "role",
                                      "filter": "frontend",
                                      "group_by": true,
                                      "type": "literal_or"
                              }],
                              "rateOptions": {
                                      "counter": true,
                                      "counterMax": 9223372036854775807,
                                      "resetValue": 1,
                                      "dropResets": false
                              },
                              "tags": {
                                      "role": "literal_or(frontend)",
                                      "env": "literal_or(prod)",
                                      "colo": "wildcard(*)"
                              }
                      }],
                      "delete": false,
                      "noAnnotations": false,
                      "globalAnnotations": false,
                      "showTSUIDs": false,
                      "msResolution": false,
                      "showQuery": false,
                      "showStats": false,
                      "showSummary": false
              },
              "exception": "null",
              "executed": 1,
              "user": null,
              "requestHeaders": {
                      "Accept-Language": "en-US,en;q=0.8",
                      "Host": "tsdhost:4242",
                      "Content-Length": "440",
                      "Referer": "http://tsdhost:8080/dashboard/db/tsdfrontend",
                      "Accept-Encoding": "gzip, deflate",
                      "X-Forwarded-For": "192.168.0.2",
                      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36",
                      "Origin": "http://tsdhost:8080",
                      "Content-Type": "application/json;charset=UTF-8",
                      "Accept": "application/json, text/plain, */*"
              },
              "numRunningQueries": 0,
              "httpResponse": {
                      "code": 200,
                      "reasonPhrase": "OK"
              },
              "queryStartTimestamp": 1455552844368,
              "queryCompletedTimestamp": 1455552844621,
              "sentToClient": true,
              "stats": {
                      "avgAggregationTime": 2.11416,
                      "avgHBaseTime": 200.267711,
                      "avgQueryScanTime": 242.037174,
                      "avgScannerTime": 200.474122,
                      "avgScannerUidToStringTime": 0.0,
                      "avgSerializationTime": 2.124153,
                      "emittedDPs": 716,
                      "maxAggregationTime": 2.093369,
                      "maxHBaseTime": 241.708782,
                      "maxQueryScanTime": 240.637231,
                      "maxScannerUidtoStringTime": 0.0,
                      "maxSerializationTime": 2.103411,
                      "maxUidToStringTime": 0.059345,
                      "processingPreWriteTime": 253.050907,
                      "successfulScan": 40,
                      "totalTime": 256.568992,
                      "uidPairsResolved": 0
              }
      }],
      "running": []
}