presto指標監控

概述

因爲presto自帶的web-ui界面侷限性比較多,所以最近準備通過分析presto的相關指標來搭建一個presto的監控平臺。主要用於presto基本信息的監控,性能信息的查詢,異常預警。所以該篇及接下來的這幾篇文章主要針對presto的相關指標及原理進行分析。

presto相關指標說明

接口

http://127.0.0.1:8888/v1/cluster
集羣狀態相關 

 1{
 2    "runningQueries": 0,               // 等待查詢個數
 3    "blockedQueries": 0,
 4    "queuedQueries": 0,               //排隊查詢個數
 5    "activeWorkers": 4,               //當前存活工作節點
 6    "runningDrivers": 0,              //當前運行driver個數
 7    "reservedMemory": 0.0,            //當前使用保留內存大熊啊
 8    "totalInputRows": 3992141,        //當前讀入數據的總行數
 9    "totalInputBytes": 1212470296,    //當前讀入數據的總大小
10    "totalCpuTimeSecs": 56202         //cpu運行時間
11}

http://127.0.0.1:8888/v1/cluster/memory
集羣內存相關

 1{
 2    "reserved": {
 3        "maxBytes": 268005959268, //最大使用內存
 4        "reservedBytes": 0,  //當前使用的內存
 5        "reservedRevocableBytes": 0,
 6        "queryMemoryReservations": {},//使用保留區的內存
 7        "queryMemoryAllocations": {},//查詢分配的內存
 8        "queryMemoryRevocableReservations": {},
 9        "freeBytes": 268005959268 //空閒內存大小
10    },
11    "general": { //正常查詢內存
12        "maxBytes": 357341279032,  //最大可使用內存
13        "reservedBytes": 0,//當前使用的內存
14        "reservedRevocableBytes": 0,
15        "queryMemoryReservations": {},//使用保留區的內存
16        "queryMemoryAllocations": {},//查詢分配的內存
17        "queryMemoryRevocableReservations": {},
18        "freeBytes": 357341279032 //當前空閒內存
19    }
20}

 

http://127.0.0.1:8888/v1/query
查詢相關

 1{
 2    "queryId": "20191106_020324_00244_pq4hz",
 3    "session": {
 4        "queryId": "20191106_020324_00241_pq4hz",     //查詢名稱
 5        "transactionId": "6e25d684-d5a5-4ac0-ab78-cd8562f7069c",
 6        "clientTransactionSupport": true,
 7        "user": "hive",    //庫名
 8        "source": "presto-jdbc",   //通過presto-jdbc
 9        "catalog": "hive",             //數據源
10        "schema": "data_test_schema",        //庫名
11        "path": {},
12        "timeZoneKey": 1937,
13        "locale": "en_US",
14        "remoteUserAddress": "127.0.0.1",
15        "userAgent": "Presto JDBC Driver/0.221",
16        "clientTags": [],
17        "clientCapabilities": ["PATH"],
18        "resourceEstimates": {},
19        "startTime": 1573005804231,    //開始時間
20        "systemProperties": {},
21        "catalogProperties": {},
22        "unprocessedCatalogProperties": {},
23        "preparedStatements": {}
24    },
25    "resourceGroupId": ["global"],
26    "state": "FINISHED",  //當前狀態
27    "memoryPool": "general",    //用的哪種內存池
28    "scheduled": true,    //計劃是否已經完成
29    "self": "http://127.0.0.1:8888/v1/query/20191106_020324_00241_pq4hz",
30    "query": " select distinct count() from test",
31    "queryStats": {
32        "createTime": "2019-11-06T01:03:24.231Z",   //創建任務時間
33        "endTime": "2019-11-06T02:03:24.707Z",   //結束任務時間
34        "queuedTime": "23.90ms",            //查詢時間
35        "elapsedTime": "476.52ms",         //運行時間
36        "executionTime": "449.59ms",       //執行時間
37        "totalDrivers": 147,                 //一共執行多少drivers
38        "queuedDrivers": 0,
39        "runningDrivers": 0,
40        "completedDrivers": 147,        //完成的drives數量
41        "rawInputDataSize": "42.36MB",  
42        "rawInputPositions": 1965000,
43        "cumulativeUserMemory": 0.0,  //累積使用內存
44        "userMemoryReservation": "0B",  
45        "totalMemoryReservation": "0B",
46        "peakUserMemoryReservation": "0B",  //使用內存峯值
47        "totalCpuTime": "251.00ms",     //cpu運行時間
48        "totalScheduledTime": "539.00ms",  //總計劃執行時間
49        "fullyBlocked": true,
50        "blockedReasons": [],
51        "progressPercentage": 100.0   //當前查詢進度
52    }
53
54}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章