Metrics API

HugeGraph 提供了获取监控信息的 Metrics 接口,比如各个 Gremlin 执行时间的统计、缓存的占用大小等。Metrics 接口包括如下几类:基础指标、统计指标、系统指标、后端存储指标。

1. 基础指标

1.1 获取所有基础指标

Params
  • type:如果传值为json,则以 json 格式返回,否则以 Promethaus 格式返回。
1.1.1 Method & Url
  1. http://localhost:8080/metrics/?type=json
Response Status
  1. 200
Response Body
  1. {
  2. "gauges": {
  3. "org.apache.hugegraph.backend.cache.Cache.edge-hugegraph.capacity": {
  4. "value": 1000000
  5. },
  6. "org.apache.hugegraph.backend.cache.Cache.edge-hugegraph.expire": {
  7. "value": 600000
  8. },
  9. "org.apache.hugegraph.backend.cache.Cache.edge-hugegraph.hits": {
  10. "value": 0
  11. },
  12. "org.apache.hugegraph.backend.cache.Cache.edge-hugegraph.miss": {
  13. "value": 0
  14. },
  15. "org.apache.hugegraph.backend.cache.Cache.edge-hugegraph.size": {
  16. "value": 0
  17. },
  18. "org.apache.hugegraph.backend.cache.Cache.instances": {
  19. "value": 7
  20. },
  21. "org.apache.hugegraph.backend.cache.Cache.schema-id-hugegraph.capacity": {
  22. "value": 10000
  23. },
  24. "org.apache.hugegraph.backend.cache.Cache.schema-id-hugegraph.expire": {
  25. "value": 0
  26. },
  27. "org.apache.hugegraph.backend.cache.Cache.schema-id-hugegraph.hits": {
  28. "value": 0
  29. },
  30. "org.apache.hugegraph.backend.cache.Cache.schema-id-hugegraph.miss": {
  31. "value": 0
  32. },
  33. "org.apache.hugegraph.backend.cache.Cache.schema-id-hugegraph.size": {
  34. "value": 17
  35. },
  36. "org.apache.hugegraph.backend.cache.Cache.schema-name-hugegraph.capacity": {
  37. "value": 10000
  38. },
  39. "org.apache.hugegraph.backend.cache.Cache.schema-name-hugegraph.expire": {
  40. "value": 0
  41. },
  42. "org.apache.hugegraph.backend.cache.Cache.schema-name-hugegraph.hits": {
  43. "value": 0
  44. },
  45. "org.apache.hugegraph.backend.cache.Cache.schema-name-hugegraph.miss": {
  46. "value": 0
  47. },
  48. "org.apache.hugegraph.backend.cache.Cache.schema-name-hugegraph.size": {
  49. "value": 17
  50. },
  51. "org.apache.hugegraph.backend.cache.Cache.token-hugegraph.capacity": {
  52. "value": 10240
  53. },
  54. "org.apache.hugegraph.backend.cache.Cache.token-hugegraph.expire": {
  55. "value": 600000
  56. },
  57. "org.apache.hugegraph.backend.cache.Cache.token-hugegraph.hits": {
  58. "value": 0
  59. },
  60. "org.apache.hugegraph.backend.cache.Cache.token-hugegraph.miss": {
  61. "value": 0
  62. },
  63. "org.apache.hugegraph.backend.cache.Cache.token-hugegraph.size": {
  64. "value": 0
  65. },
  66. "org.apache.hugegraph.backend.cache.Cache.users-hugegraph.capacity": {
  67. "value": 10240
  68. },
  69. "org.apache.hugegraph.backend.cache.Cache.users-hugegraph.expire": {
  70. "value": 600000
  71. },
  72. "org.apache.hugegraph.backend.cache.Cache.users-hugegraph.hits": {
  73. "value": 0
  74. },
  75. "org.apache.hugegraph.backend.cache.Cache.users-hugegraph.miss": {
  76. "value": 0
  77. },
  78. "org.apache.hugegraph.backend.cache.Cache.users-hugegraph.size": {
  79. "value": 0
  80. },
  81. "org.apache.hugegraph.backend.cache.Cache.users_pwd-hugegraph.capacity": {
  82. "value": 10240
  83. },
  84. "org.apache.hugegraph.backend.cache.Cache.users_pwd-hugegraph.expire": {
  85. "value": 600000
  86. },
  87. "org.apache.hugegraph.backend.cache.Cache.users_pwd-hugegraph.hits": {
  88. "value": 0
  89. },
  90. "org.apache.hugegraph.backend.cache.Cache.users_pwd-hugegraph.miss": {
  91. "value": 0
  92. },
  93. "org.apache.hugegraph.backend.cache.Cache.users_pwd-hugegraph.size": {
  94. "value": 0
  95. },
  96. "org.apache.hugegraph.backend.cache.Cache.vertex-hugegraph.capacity": {
  97. "value": 10000000
  98. },
  99. "org.apache.hugegraph.backend.cache.Cache.vertex-hugegraph.expire": {
  100. "value": 600000
  101. },
  102. "org.apache.hugegraph.backend.cache.Cache.vertex-hugegraph.hits": {
  103. "value": 0
  104. },
  105. "org.apache.hugegraph.backend.cache.Cache.vertex-hugegraph.miss": {
  106. "value": 0
  107. },
  108. "org.apache.hugegraph.backend.cache.Cache.vertex-hugegraph.size": {
  109. "value": 0
  110. },
  111. "org.apache.hugegraph.server.RestServer.max-write-threads": {
  112. "value": 0
  113. },
  114. "org.apache.hugegraph.task.TaskManager.pending-tasks": {
  115. "value": 0
  116. },
  117. "org.apache.hugegraph.task.TaskManager.workers": {
  118. "value": 4
  119. },
  120. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.average-load-penalty": {
  121. "value": 922769200
  122. },
  123. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.estimated-size": {
  124. "value": 2
  125. },
  126. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.eviction-count": {
  127. "value": 0
  128. },
  129. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.eviction-weight": {
  130. "value": 0
  131. },
  132. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.hit-count": {
  133. "value": 0
  134. },
  135. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.hit-rate": {
  136. "value": 0
  137. },
  138. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.load-count": {
  139. "value": 2
  140. },
  141. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.load-failure-count": {
  142. "value": 0
  143. },
  144. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.load-failure-rate": {
  145. "value": 0
  146. },
  147. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.load-success-count": {
  148. "value": 2
  149. },
  150. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.long-run-compilation-count": {
  151. "value": 0
  152. },
  153. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.miss-count": {
  154. "value": 2
  155. },
  156. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.miss-rate": {
  157. "value": 1
  158. },
  159. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.request-count": {
  160. "value": 2
  161. },
  162. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.total-load-time": {
  163. "value": 1845538400
  164. },
  165. "org.apache.tinkerpop.gremlin.server.GremlinServer.sessions": {
  166. "value": 0
  167. }
  168. },
  169. "counters": {
  170. "favicon.ico/GET/FAILED_COUNTER": {
  171. "count": 1
  172. },
  173. "favicon.ico/GET/TOTAL_COUNTER": {
  174. "count": 1
  175. },
  176. "metrics/POST/FAILED_COUNTER": {
  177. "count": 1
  178. },
  179. "metrics/POST/TOTAL_COUNTER": {
  180. "count": 1
  181. },
  182. "metrics/backend/GET/SUCCESS_COUNTER": {
  183. "count": 2
  184. },
  185. "metrics/backend/GET/TOTAL_COUNTER": {
  186. "count": 2
  187. },
  188. "metrics/gauges/GET/SUCCESS_COUNTER": {
  189. "count": 1
  190. },
  191. "metrics/gauges/GET/TOTAL_COUNTER": {
  192. "count": 1
  193. },
  194. "metrics/system/GET/SUCCESS_COUNTER": {
  195. "count": 2
  196. },
  197. "metrics/system/GET/TOTAL_COUNTER": {
  198. "count": 2
  199. },
  200. "system/GET/FAILED_COUNTER": {
  201. "count": 1
  202. },
  203. "system/GET/TOTAL_COUNTER": {
  204. "count": 1
  205. }
  206. },
  207. "histograms": {
  208. "favicon.ico/GET/RESPONSE_TIME_HISTOGRAM": {
  209. "count": 1,
  210. "min": 1,
  211. "mean": 1,
  212. "max": 1,
  213. "stddev": 0,
  214. "p50": 1,
  215. "p75": 1,
  216. "p95": 1,
  217. "p98": 1,
  218. "p99": 1,
  219. "p999": 1
  220. },
  221. "metrics/POST/RESPONSE_TIME_HISTOGRAM": {
  222. "count": 1,
  223. "min": 21,
  224. "mean": 21,
  225. "max": 21,
  226. "stddev": 0,
  227. "p50": 21,
  228. "p75": 21,
  229. "p95": 21,
  230. "p98": 21,
  231. "p99": 21,
  232. "p999": 21
  233. },
  234. "metrics/backend/GET/RESPONSE_TIME_HISTOGRAM": {
  235. "count": 2,
  236. "min": 6,
  237. "mean": 12.6852124529148,
  238. "max": 20,
  239. "stddev": 6.992918475157571,
  240. "p50": 6,
  241. "p75": 20,
  242. "p95": 20,
  243. "p98": 20,
  244. "p99": 20,
  245. "p999": 20
  246. },
  247. "metrics/gauges/GET/RESPONSE_TIME_HISTOGRAM": {
  248. "count": 1,
  249. "min": 7,
  250. "mean": 7,
  251. "max": 7,
  252. "stddev": 0,
  253. "p50": 7,
  254. "p75": 7,
  255. "p95": 7,
  256. "p98": 7,
  257. "p99": 7,
  258. "p999": 7
  259. },
  260. "metrics/system/GET/RESPONSE_TIME_HISTOGRAM": {
  261. "count": 2,
  262. "min": 0,
  263. "mean": 8.942674506664073,
  264. "max": 40,
  265. "stddev": 16.665399873223066,
  266. "p50": 0,
  267. "p75": 0,
  268. "p95": 40,
  269. "p98": 40,
  270. "p99": 40,
  271. "p999": 40
  272. },
  273. "system/GET/RESPONSE_TIME_HISTOGRAM": {
  274. "count": 1,
  275. "min": 2,
  276. "mean": 2,
  277. "max": 2,
  278. "stddev": 0,
  279. "p50": 2,
  280. "p75": 2,
  281. "p95": 2,
  282. "p98": 2,
  283. "p99": 2,
  284. "p999": 2
  285. }
  286. },
  287. "meters": {
  288. "org.apache.hugegraph.api.API.commit-succeed": {
  289. "count": 0,
  290. "mean_rate": 0,
  291. "m15_rate": 0,
  292. "m5_rate": 0,
  293. "m1_rate": 0,
  294. "rate_unit": "events/second"
  295. },
  296. "org.apache.hugegraph.api.API.expected-error": {
  297. "count": 0,
  298. "mean_rate": 0,
  299. "m15_rate": 0,
  300. "m5_rate": 0,
  301. "m1_rate": 0,
  302. "rate_unit": "events/second"
  303. },
  304. "org.apache.hugegraph.api.API.illegal-arg": {
  305. "count": 0,
  306. "mean_rate": 0,
  307. "m15_rate": 0,
  308. "m5_rate": 0,
  309. "m1_rate": 0,
  310. "rate_unit": "events/second"
  311. },
  312. "org.apache.hugegraph.api.API.unknown-error": {
  313. "count": 0,
  314. "mean_rate": 0,
  315. "m15_rate": 0,
  316. "m5_rate": 0,
  317. "m1_rate": 0,
  318. "rate_unit": "events/second"
  319. },
  320. "org.apache.tinkerpop.gremlin.server.GremlinServer.errors": {
  321. "count": 0,
  322. "mean_rate": 0,
  323. "m15_rate": 0,
  324. "m5_rate": 0,
  325. "m1_rate": 0,
  326. "rate_unit": "events/second"
  327. }
  328. },
  329. "timers": {
  330. "org.apache.hugegraph.api.auth.AccessAPI.create": {
  331. "count": 0,
  332. "min": 0,
  333. "mean": 0,
  334. "max": 0,
  335. "stddev": 0,
  336. "p50": 0,
  337. "p75": 0,
  338. "p95": 0,
  339. "p98": 0,
  340. "p99": 0,
  341. "p999": 0,
  342. "duration_unit": "milliseconds",
  343. "mean_rate": 0,
  344. "m15_rate": 0,
  345. "m5_rate": 0,
  346. "m1_rate": 0,
  347. "rate_unit": "calls/second"
  348. },
  349. "org.apache.hugegraph.api.auth.AccessAPI.delete": {
  350. "count": 0,
  351. "min": 0,
  352. "mean": 0,
  353. "max": 0,
  354. "stddev": 0,
  355. "p50": 0,
  356. "p75": 0,
  357. "p95": 0,
  358. "p98": 0,
  359. "p99": 0,
  360. "p999": 0,
  361. "duration_unit": "milliseconds",
  362. "mean_rate": 0,
  363. "m15_rate": 0,
  364. "m5_rate": 0,
  365. "m1_rate": 0,
  366. "rate_unit": "calls/second"
  367. },
  368. "org.apache.hugegraph.api.auth.AccessAPI.get": {
  369. "count": 0,
  370. "min": 0,
  371. "mean": 0,
  372. "max": 0,
  373. "stddev": 0,
  374. "p50": 0,
  375. "p75": 0,
  376. "p95": 0,
  377. "p98": 0,
  378. "p99": 0,
  379. "p999": 0,
  380. "duration_unit": "milliseconds",
  381. "mean_rate": 0,
  382. "m15_rate": 0,
  383. "m5_rate": 0,
  384. "m1_rate": 0,
  385. "rate_unit": "calls/second"
  386. },
  387. "org.apache.hugegraph.api.auth.AccessAPI.list": {
  388. "count": 0,
  389. "min": 0,
  390. "mean": 0,
  391. "max": 0,
  392. "stddev": 0,
  393. "p50": 0,
  394. "p75": 0,
  395. "p95": 0,
  396. "p98": 0,
  397. "p99": 0,
  398. "p999": 0,
  399. "duration_unit": "milliseconds",
  400. "mean_rate": 0,
  401. "m15_rate": 0,
  402. "m5_rate": 0,
  403. "m1_rate": 0,
  404. "rate_unit": "calls/second"
  405. },
  406. ...
  407. }
  408. }
1.1.2 Method & Url
  1. http://localhost:8080/metrics/
Response Status
  1. 200
Response Body
  1. # HELP hugegraph_info
  2. # TYPE hugegraph_info untyped
  3. hugegraph_info{version="0.69",
  4. } 1.0
  5. # HELP org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_capacity
  6. # TYPE org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_capacity gauge
  7. org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_capacity 1000000
  8. # HELP org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_expire
  9. # TYPE org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_expire gauge
  10. org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_expire 600000
  11. # HELP org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_hits
  12. # TYPE org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_hits gauge
  13. org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_hits 0
  14. # HELP org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_miss
  15. # TYPE org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_miss gauge
  16. org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_miss 0
  17. # HELP org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_size
  18. # TYPE org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_size gauge
  19. org_apache_hugegraph_backend_cache_Cache_edge_hugegraph_size 0
  20. # HELP org_apache_hugegraph_backend_cache_Cache_instances
  21. # TYPE org_apache_hugegraph_backend_cache_Cache_instances gauge
  22. org_apache_hugegraph_backend_cache_Cache_instances 7
  23. # HELP org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_capacity
  24. # TYPE org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_capacity gauge
  25. org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_capacity 10000
  26. # HELP org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_expire
  27. # TYPE org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_expire gauge
  28. org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_expire 0
  29. # HELP org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_hits
  30. # TYPE org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_hits gauge
  31. org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_hits 0
  32. # HELP org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_miss
  33. # TYPE org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_miss gauge
  34. org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_miss 0
  35. # HELP org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_size
  36. # TYPE org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_size gauge
  37. org_apache_hugegraph_backend_cache_Cache_schema_id_hugegraph_size 17
  38. # HELP org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_capacity
  39. # TYPE org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_capacity gauge
  40. org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_capacity 10000
  41. # HELP org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_expire
  42. # TYPE org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_expire gauge
  43. org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_expire 0
  44. # HELP org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_hits
  45. # TYPE org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_hits gauge
  46. org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_hits 0
  47. # HELP org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_miss
  48. # TYPE org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_miss gauge
  49. org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_miss 0
  50. # HELP org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_size
  51. # TYPE org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_size gauge
  52. org_apache_hugegraph_backend_cache_Cache_schema_name_hugegraph_size 17
  53. ...

1.2 获取 Gauges 指标

Method & Url
  1. http://localhost:8080/metrics/gauges
Response Status
  1. 200
Response Body
  1. {
  2. "org.apache.hugegraph.backend.cache.Cache.edge-hugegraph.capacity": {
  3. "value": 1000000
  4. },
  5. "org.apache.hugegraph.backend.cache.Cache.edge-hugegraph.expire": {
  6. "value": 600000
  7. },
  8. "org.apache.hugegraph.backend.cache.Cache.edge-hugegraph.hits": {
  9. "value": 0
  10. },
  11. "org.apache.hugegraph.backend.cache.Cache.edge-hugegraph.miss": {
  12. "value": 0
  13. },
  14. "org.apache.hugegraph.backend.cache.Cache.edge-hugegraph.size": {
  15. "value": 0
  16. },
  17. "org.apache.hugegraph.backend.cache.Cache.instances": {
  18. "value": 7
  19. },
  20. "org.apache.hugegraph.backend.cache.Cache.schema-id-hugegraph.capacity": {
  21. "value": 10000
  22. },
  23. "org.apache.hugegraph.backend.cache.Cache.schema-id-hugegraph.expire": {
  24. "value": 0
  25. },
  26. "org.apache.hugegraph.backend.cache.Cache.schema-id-hugegraph.hits": {
  27. "value": 0
  28. },
  29. "org.apache.hugegraph.backend.cache.Cache.schema-id-hugegraph.miss": {
  30. "value": 0
  31. },
  32. "org.apache.hugegraph.backend.cache.Cache.schema-id-hugegraph.size": {
  33. "value": 17
  34. },
  35. "org.apache.hugegraph.backend.cache.Cache.schema-name-hugegraph.capacity": {
  36. "value": 10000
  37. },
  38. "org.apache.hugegraph.backend.cache.Cache.schema-name-hugegraph.expire": {
  39. "value": 0
  40. },
  41. "org.apache.hugegraph.backend.cache.Cache.schema-name-hugegraph.hits": {
  42. "value": 0
  43. },
  44. "org.apache.hugegraph.backend.cache.Cache.schema-name-hugegraph.miss": {
  45. "value": 0
  46. },
  47. "org.apache.hugegraph.backend.cache.Cache.schema-name-hugegraph.size": {
  48. "value": 17
  49. },
  50. "org.apache.hugegraph.backend.cache.Cache.token-hugegraph.capacity": {
  51. "value": 10240
  52. },
  53. "org.apache.hugegraph.backend.cache.Cache.token-hugegraph.expire": {
  54. "value": 600000
  55. },
  56. "org.apache.hugegraph.backend.cache.Cache.token-hugegraph.hits": {
  57. "value": 0
  58. },
  59. "org.apache.hugegraph.backend.cache.Cache.token-hugegraph.miss": {
  60. "value": 0
  61. },
  62. "org.apache.hugegraph.backend.cache.Cache.token-hugegraph.size": {
  63. "value": 0
  64. },
  65. "org.apache.hugegraph.backend.cache.Cache.users-hugegraph.capacity": {
  66. "value": 10240
  67. },
  68. "org.apache.hugegraph.backend.cache.Cache.users-hugegraph.expire": {
  69. "value": 600000
  70. },
  71. "org.apache.hugegraph.backend.cache.Cache.users-hugegraph.hits": {
  72. "value": 0
  73. },
  74. "org.apache.hugegraph.backend.cache.Cache.users-hugegraph.miss": {
  75. "value": 0
  76. },
  77. "org.apache.hugegraph.backend.cache.Cache.users-hugegraph.size": {
  78. "value": 0
  79. },
  80. "org.apache.hugegraph.backend.cache.Cache.users_pwd-hugegraph.capacity": {
  81. "value": 10240
  82. },
  83. "org.apache.hugegraph.backend.cache.Cache.users_pwd-hugegraph.expire": {
  84. "value": 600000
  85. },
  86. "org.apache.hugegraph.backend.cache.Cache.users_pwd-hugegraph.hits": {
  87. "value": 0
  88. },
  89. "org.apache.hugegraph.backend.cache.Cache.users_pwd-hugegraph.miss": {
  90. "value": 0
  91. },
  92. "org.apache.hugegraph.backend.cache.Cache.users_pwd-hugegraph.size": {
  93. "value": 0
  94. },
  95. "org.apache.hugegraph.backend.cache.Cache.vertex-hugegraph.capacity": {
  96. "value": 10000000
  97. },
  98. "org.apache.hugegraph.backend.cache.Cache.vertex-hugegraph.expire": {
  99. "value": 600000
  100. },
  101. "org.apache.hugegraph.backend.cache.Cache.vertex-hugegraph.hits": {
  102. "value": 0
  103. },
  104. "org.apache.hugegraph.backend.cache.Cache.vertex-hugegraph.miss": {
  105. "value": 0
  106. },
  107. "org.apache.hugegraph.backend.cache.Cache.vertex-hugegraph.size": {
  108. "value": 0
  109. },
  110. "org.apache.hugegraph.server.RestServer.max-write-threads": {
  111. "value": 0
  112. },
  113. "org.apache.hugegraph.task.TaskManager.pending-tasks": {
  114. "value": 0
  115. },
  116. "org.apache.hugegraph.task.TaskManager.workers": {
  117. "value": 4
  118. },
  119. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.average-load-penalty": {
  120. "value": 9.227692E8
  121. },
  122. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.estimated-size": {
  123. "value": 2
  124. },
  125. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.eviction-count": {
  126. "value": 0
  127. },
  128. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.eviction-weight": {
  129. "value": 0
  130. },
  131. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.hit-count": {
  132. "value": 0
  133. },
  134. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.hit-rate": {
  135. "value": 0.0
  136. },
  137. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.load-count": {
  138. "value": 2
  139. },
  140. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.load-failure-count": {
  141. "value": 0
  142. },
  143. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.load-failure-rate": {
  144. "value": 0.0
  145. },
  146. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.load-success-count": {
  147. "value": 2
  148. },
  149. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.long-run-compilation-count": {
  150. "value": 0
  151. },
  152. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.miss-count": {
  153. "value": 2
  154. },
  155. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.miss-rate": {
  156. "value": 1.0
  157. },
  158. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.request-count": {
  159. "value": 2
  160. },
  161. "org.apache.tinkerpop.gremlin.server.GremlinServer.gremlin-groovy.sessionless.class-cache.total-load-time": {
  162. "value": 1845538400
  163. },
  164. "org.apache.tinkerpop.gremlin.server.GremlinServer.sessions": {
  165. "value": 0
  166. }
  167. }

1.3 获取 Counters 指标

Method & Url
  1. GET http://localhost:8080/metrics/counters
Response Status
  1. 200
Response Body
  1. {
  2. "favicon.ico/GET/FAILED_COUNTER": {
  3. "count": 1
  4. },
  5. "favicon.ico/GET/TOTAL_COUNTER": {
  6. "count": 1
  7. },
  8. "metrics//GET/SUCCESS_COUNTER": {
  9. "count": 2
  10. },
  11. "metrics//GET/TOTAL_COUNTER": {
  12. "count": 2
  13. },
  14. "metrics/POST/FAILED_COUNTER": {
  15. "count": 1
  16. },
  17. "metrics/POST/TOTAL_COUNTER": {
  18. "count": 1
  19. },
  20. "metrics/backend/GET/SUCCESS_COUNTER": {
  21. "count": 2
  22. },
  23. "metrics/backend/GET/TOTAL_COUNTER": {
  24. "count": 2
  25. },
  26. "metrics/gauges/GET/SUCCESS_COUNTER": {
  27. "count": 1
  28. },
  29. "metrics/gauges/GET/TOTAL_COUNTER": {
  30. "count": 1
  31. },
  32. "metrics/statistics/GET/SUCCESS_COUNTER": {
  33. "count": 2
  34. },
  35. "metrics/statistics/GET/TOTAL_COUNTER": {
  36. "count": 2
  37. },
  38. "metrics/system/GET/SUCCESS_COUNTER": {
  39. "count": 2
  40. },
  41. "metrics/system/GET/TOTAL_COUNTER": {
  42. "count": 2
  43. },
  44. "metrics/timers/GET/SUCCESS_COUNTER": {
  45. "count": 1
  46. },
  47. "metrics/timers/GET/TOTAL_COUNTER": {
  48. "count": 1
  49. },
  50. "system/GET/FAILED_COUNTER": {
  51. "count": 1
  52. },
  53. "system/GET/TOTAL_COUNTER": {
  54. "count": 1
  55. }
  56. }

1.4 获取 histograms 指标

Method & Url
  1. GET http://localhost:8080/metrics/gauges
Response Status
  1. 200
Response Body
  1. {
  2. "favicon.ico/GET/RESPONSE_TIME_HISTOGRAM": {
  3. "count": 1,
  4. "min": 1,
  5. "mean": 1.0,
  6. "max": 1,
  7. "stddev": 0.0,
  8. "p50": 1.0,
  9. "p75": 1.0,
  10. "p95": 1.0,
  11. "p98": 1.0,
  12. "p99": 1.0,
  13. "p999": 1.0
  14. },
  15. "metrics//GET/RESPONSE_TIME_HISTOGRAM": {
  16. "count": 2,
  17. "min": 10,
  18. "mean": 10.0,
  19. "max": 10,
  20. "stddev": 0.0,
  21. "p50": 10.0,
  22. "p75": 10.0,
  23. "p95": 10.0,
  24. "p98": 10.0,
  25. "p99": 10.0,
  26. "p999": 10.0
  27. },
  28. "metrics/POST/RESPONSE_TIME_HISTOGRAM": {
  29. "count": 1,
  30. "min": 21,
  31. "mean": 21.0,
  32. "max": 21,
  33. "stddev": 0.0,
  34. "p50": 21.0,
  35. "p75": 21.0,
  36. "p95": 21.0,
  37. "p98": 21.0,
  38. "p99": 21.0,
  39. "p999": 21.0
  40. },
  41. "metrics/backend/GET/RESPONSE_TIME_HISTOGRAM": {
  42. "count": 2,
  43. "min": 6,
  44. "mean": 12.6852124529148,
  45. "max": 20,
  46. "stddev": 6.992918475157571,
  47. "p50": 6.0,
  48. "p75": 20.0,
  49. "p95": 20.0,
  50. "p98": 20.0,
  51. "p99": 20.0,
  52. "p999": 20.0
  53. },
  54. "metrics/gauges/GET/RESPONSE_TIME_HISTOGRAM": {
  55. "count": 1,
  56. "min": 7,
  57. "mean": 7.0,
  58. "max": 7,
  59. "stddev": 0.0,
  60. "p50": 7.0,
  61. "p75": 7.0,
  62. "p95": 7.0,
  63. "p98": 7.0,
  64. "p99": 7.0,
  65. "p999": 7.0
  66. },
  67. "metrics/statistics/GET/RESPONSE_TIME_HISTOGRAM": {
  68. "count": 2,
  69. "min": 1,
  70. "mean": 1.4551211076264199,
  71. "max": 2,
  72. "stddev": 0.49798181193626,
  73. "p50": 1.0,
  74. "p75": 2.0,
  75. "p95": 2.0,
  76. "p98": 2.0,
  77. "p99": 2.0,
  78. "p999": 2.0
  79. },
  80. "metrics/system/GET/RESPONSE_TIME_HISTOGRAM": {
  81. "count": 2,
  82. "min": 0,
  83. "mean": 8.942674506664073,
  84. "max": 40,
  85. "stddev": 16.665399873223066,
  86. "p50": 0.0,
  87. "p75": 0.0,
  88. "p95": 40.0,
  89. "p98": 40.0,
  90. "p99": 40.0,
  91. "p999": 40.0
  92. },
  93. "metrics/timers/GET/RESPONSE_TIME_HISTOGRAM": {
  94. "count": 1,
  95. "min": 3,
  96. "mean": 3.0,
  97. "max": 3,
  98. "stddev": 0.0,
  99. "p50": 3.0,
  100. "p75": 3.0,
  101. "p95": 3.0,
  102. "p98": 3.0,
  103. "p99": 3.0,
  104. "p999": 3.0
  105. },
  106. "system/GET/RESPONSE_TIME_HISTOGRAM": {
  107. "count": 1,
  108. "min": 2,
  109. "mean": 2.0,
  110. "max": 2,
  111. "stddev": 0.0,
  112. "p50": 2.0,
  113. "p75": 2.0,
  114. "p95": 2.0,
  115. "p98": 2.0,
  116. "p99": 2.0,
  117. "p999": 2.0
  118. }
  119. }

1.5 获取 meters 指标

Method & Url
  1. GET http://localhost:8080/metrics/meters
Response Status
  1. 200
Response Body
  1. {
  2. "org.apache.hugegraph.api.API.commit-succeed": {
  3. "count": 0,
  4. "mean_rate": 0.0,
  5. "m15_rate": 0.0,
  6. "m5_rate": 0.0,
  7. "m1_rate": 0.0,
  8. "rate_unit": "events/second"
  9. },
  10. "org.apache.hugegraph.api.API.expected-error": {
  11. "count": 0,
  12. "mean_rate": 0.0,
  13. "m15_rate": 0.0,
  14. "m5_rate": 0.0,
  15. "m1_rate": 0.0,
  16. "rate_unit": "events/second"
  17. },
  18. "org.apache.hugegraph.api.API.illegal-arg": {
  19. "count": 0,
  20. "mean_rate": 0.0,
  21. "m15_rate": 0.0,
  22. "m5_rate": 0.0,
  23. "m1_rate": 0.0,
  24. "rate_unit": "events/second"
  25. },
  26. "org.apache.hugegraph.api.API.unknown-error": {
  27. "count": 0,
  28. "mean_rate": 0.0,
  29. "m15_rate": 0.0,
  30. "m5_rate": 0.0,
  31. "m1_rate": 0.0,
  32. "rate_unit": "events/second"
  33. },
  34. "org.apache.tinkerpop.gremlin.server.GremlinServer.errors": {
  35. "count": 0,
  36. "mean_rate": 0.0,
  37. "m15_rate": 0.0,
  38. "m5_rate": 0.0,
  39. "m1_rate": 0.0,
  40. "rate_unit": "events/second"
  41. }
  42. }

1.6 获取 timers 指标

Method & Url
  1. GET http://localhost:8080/metrics/timers
Response Status
  1. 200
Response Body
  1. {
  2. "org.apache.hugegraph.api.auth.AccessAPI.create": {
  3. "count": 0,
  4. "min": 0.0,
  5. "mean": 0.0,
  6. "max": 0.0,
  7. "stddev": 0.0,
  8. "p50": 0.0,
  9. "p75": 0.0,
  10. "p95": 0.0,
  11. "p98": 0.0,
  12. "p99": 0.0,
  13. "p999": 0.0,
  14. "duration_unit": "milliseconds",
  15. "mean_rate": 0.0,
  16. "m15_rate": 0.0,
  17. "m5_rate": 0.0,
  18. "m1_rate": 0.0,
  19. "rate_unit": "calls/second"
  20. },
  21. "org.apache.hugegraph.api.auth.AccessAPI.delete": {
  22. "count": 0,
  23. "min": 0.0,
  24. "mean": 0.0,
  25. "max": 0.0,
  26. "stddev": 0.0,
  27. "p50": 0.0,
  28. "p75": 0.0,
  29. "p95": 0.0,
  30. "p98": 0.0,
  31. "p99": 0.0,
  32. "p999": 0.0,
  33. "duration_unit": "milliseconds",
  34. "mean_rate": 0.0,
  35. "m15_rate": 0.0,
  36. "m5_rate": 0.0,
  37. "m1_rate": 0.0,
  38. "rate_unit": "calls/second"
  39. },
  40. ...
  41. }

2.统计指标

Params
  • type:如果传值为 json,则以 json 格式返回,否则以 Promethaus 格式返回。
2.1 Method & Url
  1. GET http://localhost:8080/metrics/statistics
Response Status
  1. # HELP hugegraph_info
  2. # TYPE hugegraph_info untyped
  3. hugegraph_info{version="0.69",
  4. } 1.0
  5. # HELP metrics_POST
  6. # TYPE metrics_POST gauge
  7. metrics_POST{name=FAILED_REQUEST,} 1
  8. metrics_POST{name=MEAN_RESPONSE_TIME,} 21.0
  9. metrics_POST{
  10. name=MAX_RESPONSE_TIME,
  11. } 21
  12. metrics_POST{name=SUCCESS_REQUEST,
  13. } 0
  14. metrics_POST{
  15. name=TOTAL_REQUEST,
  16. } 1
  17. # HELP metrics_backend_GET
  18. # TYPE metrics_backend_GET gauge
  19. metrics_backend_GET{name=FAILED_REQUEST,
  20. } 0
  21. metrics_backend_GET{
  22. name=MEAN_RESPONSE_TIME,
  23. } 12.6852124529148
  24. metrics_backend_GET{
  25. name=MAX_RESPONSE_TIME,
  26. } 20
  27. metrics_backend_GET{
  28. name=SUCCESS_REQUEST,
  29. } 2
  30. metrics_backend_GET{name=TOTAL_REQUEST,} 2
  31. # HELP system_GET
  32. # TYPE system_GET gauge
  33. system_GET{name=FAILED_REQUEST,} 1
  34. system_GET{name=MEAN_RESPONSE_TIME,} 2.0
  35. system_GET{name=MAX_RESPONSE_TIME,} 2
  36. system_GET{
  37. name=SUCCESS_REQUEST,
  38. } 0
  39. system_GET{name=TOTAL_REQUEST,
  40. } 1
  41. # HELP metrics_gauges_GET
  42. # TYPE metrics_gauges_GET gauge
  43. metrics_gauges_GET{name=FAILED_REQUEST,} 0
  44. metrics_gauges_GET{name=MEAN_RESPONSE_TIME,
  45. } 7.0
  46. metrics_gauges_GET{
  47. name=MAX_RESPONSE_TIME,
  48. } 7
  49. metrics_gauges_GET{
  50. name=SUCCESS_REQUEST,
  51. } 1
  52. metrics_gauges_GET{
  53. name=TOTAL_REQUEST,
  54. } 1
  55. # HELP favicon.ico_GET
  56. # TYPE favicon.ico_GET gauge
  57. favicon.ico_GET{name=FAILED_REQUEST,
  58. } 1
  59. favicon.ico_GET{
  60. name=MEAN_RESPONSE_TIME,
  61. } 1.0
  62. favicon.ico_GET{name=MAX_RESPONSE_TIME,} 1
  63. favicon.ico_GET{name=SUCCESS_REQUEST,} 0
  64. favicon.ico_GET{
  65. name=TOTAL_REQUEST,
  66. } 1
  67. # HELP metrics__GET
  68. # TYPE metrics__GET gauge
  69. metrics__GET{name=FAILED_REQUEST,} 0
  70. metrics__GET{name=MEAN_RESPONSE_TIME,} 10.0
  71. metrics__GET{name=MAX_RESPONSE_TIME,
  72. } 10
  73. metrics__GET{
  74. name=SUCCESS_REQUEST,
  75. } 2
  76. metrics__GET{
  77. name=TOTAL_REQUEST,
  78. } 2
  79. # HELP metrics_system_GET
  80. # TYPE metrics_system_GET gauge
  81. metrics_system_GET{name=FAILED_REQUEST,} 0
  82. metrics_system_GET{name=MEAN_RESPONSE_TIME,
  83. } 8.942674506664073
  84. metrics_system_GET{
  85. name=MAX_RESPONSE_TIME,
  86. } 40
  87. metrics_system_GET{name=SUCCESS_REQUEST,} 2
  88. metrics_system_GET{name=TOTAL_REQUEST,
  89. } 2
Response Body
  1. 200
2.2 Method & Url
  1. GET http://localhost:8080/metrics/statistics?type=json
Response Status
  1. 200
Response Body
  1. {
  2. "metrics/POST": {
  3. "FAILED_REQUEST": 1,
  4. "MEAN_RESPONSE_TIME": 21,
  5. "MAX_RESPONSE_TIME": 21,
  6. "SUCCESS_REQUEST": 0,
  7. "TOTAL_REQUEST": 1
  8. },
  9. "metrics/backend/GET": {
  10. "FAILED_REQUEST": 0,
  11. "MEAN_RESPONSE_TIME": 12.6852124529148,
  12. "MAX_RESPONSE_TIME": 20,
  13. "SUCCESS_REQUEST": 2,
  14. "TOTAL_REQUEST": 2
  15. },
  16. "system/GET": {
  17. "FAILED_REQUEST": 1,
  18. "MEAN_RESPONSE_TIME": 2,
  19. "MAX_RESPONSE_TIME": 2,
  20. "SUCCESS_REQUEST": 0,
  21. "TOTAL_REQUEST": 1
  22. },
  23. "metrics/gauges/GET": {
  24. "FAILED_REQUEST": 0,
  25. "MEAN_RESPONSE_TIME": 7,
  26. "MAX_RESPONSE_TIME": 7,
  27. "SUCCESS_REQUEST": 1,
  28. "TOTAL_REQUEST": 1
  29. },
  30. "favicon.ico/GET": {
  31. "FAILED_REQUEST": 1,
  32. "MEAN_RESPONSE_TIME": 1,
  33. "MAX_RESPONSE_TIME": 1,
  34. "SUCCESS_REQUEST": 0,
  35. "TOTAL_REQUEST": 1
  36. },
  37. "metrics//GET": {
  38. "FAILED_REQUEST": 0,
  39. "MEAN_RESPONSE_TIME": 10,
  40. "MAX_RESPONSE_TIME": 10,
  41. "SUCCESS_REQUEST": 2,
  42. "TOTAL_REQUEST": 2
  43. },
  44. "metrics/system/GET": {
  45. "FAILED_REQUEST": 0,
  46. "MEAN_RESPONSE_TIME": 8.942674506664073,
  47. "MAX_RESPONSE_TIME": 40,
  48. "SUCCESS_REQUEST": 2,
  49. "TOTAL_REQUEST": 2
  50. }
  51. }

3.系统指标

系统指标主要返回机器运行指标,如内存、线程等信息。

Method & Url
  1. GET http://localhost:8080/metrics/system
Response Status
  1. 200
Response Body
  1. {
  2. "basic": {
  3. "mem": 1010,
  4. "mem_total": 911,
  5. "mem_used": 239,
  6. "mem_free": 671,
  7. "mem_unit": "MB",
  8. "processors": 20,
  9. "uptime": 137503,
  10. "systemload_average": -1.0
  11. },
  12. "heap": {
  13. "committed": 911,
  14. "init": 254,
  15. "used": 239,
  16. "max": 3596
  17. },
  18. "nonheap": {
  19. "committed": 98,
  20. "init": 2,
  21. "used": 95,
  22. "max": 0
  23. },
  24. "thread": {
  25. "peak": 82,
  26. "daemon": 34,
  27. "total_started": 108,
  28. "count": 82
  29. },
  30. "class_loading": {
  31. "count": 11495,
  32. "loaded": 11495,
  33. "unloaded": 0
  34. },
  35. "garbage_collector": {
  36. "ps_scavenge_count": 16,
  37. "ps_scavenge_time": 155,
  38. "ps_marksweep_count": 3,
  39. "ps_marksweep_time": 494,
  40. "time_unit": "ms"
  41. }
  42. }

4.后端指标

hugeGraph 支持多种后端存储,后端指标包括内存、磁盘等信息。

Method & Url
  1. GET http://localhost:8080/metrics/backend
Response Status
  1. 200
Response Body
  1. {
  2. "hugegraph": {
  3. "backend": "rocksdb",
  4. "nodes": 1,
  5. "cluster_id": "local",
  6. "servers": {
  7. "local": {
  8. "mem_unit": "MB",
  9. "disk_unit": "GB",
  10. "mem_used": 0.1,
  11. "mem_used_readable": "103.53 KB",
  12. "disk_usage": 0.03,
  13. "disk_usage_readable": "29.03 KB",
  14. "block_cache_usage": 0.00359344482421875,
  15. "block_cache_pinned_usage": 0.00359344482421875,
  16. "block_cache_capacity": 304.0,
  17. "estimate_table_readers_mem": 0.019697189331054688,
  18. "size_all_mem_tables": 0.07421875,
  19. "cur_size_all_mem_tables": 0.07421875,
  20. "estimate_live_data_size": 5.536526441574097E-5,
  21. "total_sst_files_size": 5.536526441574097E-5,
  22. "live_sst_files_size": 5.536526441574097E-5,
  23. "estimate_pending_compaction_bytes": 0.0,
  24. "estimate_num_keys": 0,
  25. "num_entries_active_mem_table": 0,
  26. "num_entries_imm_mem_tables": 0,
  27. "num_deletes_active_mem_table": 0,
  28. "num_deletes_imm_mem_tables": 0,
  29. "num_running_flushes": 0,
  30. "mem_table_flush_pending": 0,
  31. "num_running_compactions": 0,
  32. "compaction_pending": 0,
  33. "num_immutable_mem_table": 0,
  34. "num_snapshots": 0,
  35. "oldest_snapshot_time": 0,
  36. "num_live_versions": 38,
  37. "current_super_version_number": 38
  38. }
  39. }
  40. }
  41. }

Last modified November 20, 2023: doc: add cassandra docker usage of server & enhance loader desc (#299) (e853a54b)