kernel_vmstat.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package measurements
  15. import "yunion.io/x/onecloud/pkg/apis/monitor"
  16. var kernelVmstat = SMeasurement{
  17. Context: []SMonitorContext{
  18. {
  19. Name: "kernel_vmstat",
  20. DisplayName: "kernel vmstat",
  21. ResourceType: monitor.METRIC_RES_TYPE_HOST,
  22. Database: monitor.METRIC_DATABASE_TELE,
  23. },
  24. },
  25. Metrics: []SMetric{
  26. {
  27. Name: "nr_free_pages",
  28. DisplayName: "nr_free_pages",
  29. Unit: monitor.METRIC_UNIT_COUNT,
  30. },
  31. {
  32. Name: "nr_inactive_anon",
  33. DisplayName: "(integer, nr_inactive_anon)",
  34. Unit: monitor.METRIC_UNIT_COUNT,
  35. },
  36. {
  37. Name: "nr_active_anon",
  38. DisplayName: "(integer, nr_active_anon)",
  39. Unit: monitor.METRIC_UNIT_COUNT,
  40. },
  41. {
  42. Name: "nr_inactive_file",
  43. DisplayName: "(integer, nr_inactive_file)",
  44. Unit: monitor.METRIC_UNIT_COUNT,
  45. },
  46. {
  47. Name: "nr_active_file",
  48. DisplayName: "(integer, nr_active_file)",
  49. Unit: monitor.METRIC_UNIT_COUNT,
  50. },
  51. {
  52. Name: "nr_unevictable",
  53. DisplayName: "(integer, nr_unevictable)",
  54. Unit: monitor.METRIC_UNIT_COUNT,
  55. },
  56. {
  57. Name: "nr_mlock",
  58. DisplayName: "(integer, nr_mlock)",
  59. Unit: monitor.METRIC_UNIT_COUNT,
  60. },
  61. {
  62. Name: "nr_anon_pages",
  63. DisplayName: "(integer, nr_anon_pages)",
  64. Unit: monitor.METRIC_UNIT_COUNT,
  65. },
  66. {
  67. Name: "nr_mapped",
  68. DisplayName: "(integer, nr_mapped)",
  69. Unit: monitor.METRIC_UNIT_COUNT,
  70. },
  71. {
  72. Name: "nr_file_pages",
  73. DisplayName: "(integer, nr_file_pages)",
  74. Unit: monitor.METRIC_UNIT_COUNT,
  75. },
  76. {
  77. Name: "nr_dirty",
  78. DisplayName: "(integer, nr_dirty)",
  79. Unit: monitor.METRIC_UNIT_COUNT,
  80. },
  81. {
  82. Name: "nr_writeback",
  83. DisplayName: "(integer, nr_writeback)",
  84. Unit: monitor.METRIC_UNIT_COUNT,
  85. },
  86. {
  87. Name: "nr_slab_reclaimable",
  88. DisplayName: "(integer, nr_slab_reclaimable)",
  89. Unit: monitor.METRIC_UNIT_COUNT,
  90. },
  91. {
  92. Name: "nr_slab_unreclaimable",
  93. DisplayName: "(integer, nr_slab_unreclaimable)",
  94. Unit: monitor.METRIC_UNIT_COUNT,
  95. },
  96. {
  97. Name: "nr_page_table_pages",
  98. DisplayName: "(integer, nr_page_table_pages)",
  99. Unit: monitor.METRIC_UNIT_COUNT,
  100. },
  101. {
  102. Name: "nr_kernel_stack",
  103. DisplayName: "(integer, nr_kernel_stack)",
  104. Unit: monitor.METRIC_UNIT_COUNT,
  105. },
  106. {
  107. Name: "nr_unstable",
  108. DisplayName: "(integer, nr_unstable)",
  109. Unit: monitor.METRIC_UNIT_COUNT,
  110. },
  111. {
  112. Name: "nr_bounce",
  113. DisplayName: "(integer, nr_bounce)",
  114. Unit: monitor.METRIC_UNIT_COUNT,
  115. },
  116. {
  117. Name: "nr_vmscan_write",
  118. DisplayName: "(integer, nr_vmscan_write)",
  119. Unit: monitor.METRIC_UNIT_COUNT,
  120. },
  121. {
  122. Name: "nr_writeback_temp",
  123. DisplayName: "(integer, nr_writeback_temp)",
  124. Unit: monitor.METRIC_UNIT_COUNT,
  125. },
  126. {
  127. Name: "nr_isolated_anon",
  128. DisplayName: "(integer, nr_isolated_anon)",
  129. Unit: monitor.METRIC_UNIT_COUNT,
  130. },
  131. {
  132. Name: "nr_isolated_file",
  133. DisplayName: "(integer, nr_isolated_file)",
  134. Unit: monitor.METRIC_UNIT_COUNT,
  135. },
  136. {
  137. Name: "nr_shmem",
  138. DisplayName: "(integer, nr_shmem)",
  139. Unit: monitor.METRIC_UNIT_COUNT,
  140. },
  141. {
  142. Name: "numa_hit",
  143. DisplayName: "(integer, numa_hit)",
  144. Unit: monitor.METRIC_UNIT_COUNT,
  145. },
  146. {
  147. Name: "numa_miss",
  148. DisplayName: "(integer, numa_miss)",
  149. Unit: monitor.METRIC_UNIT_COUNT,
  150. },
  151. {
  152. Name: "numa_foreign",
  153. DisplayName: "(integer, numa_foreign)",
  154. Unit: monitor.METRIC_UNIT_COUNT,
  155. },
  156. {
  157. Name: "numa_interleave",
  158. DisplayName: "(integer, numa_interleave)",
  159. Unit: monitor.METRIC_UNIT_COUNT,
  160. },
  161. {
  162. Name: "numa_local",
  163. DisplayName: "(integer, numa_local)",
  164. Unit: monitor.METRIC_UNIT_COUNT,
  165. },
  166. {
  167. Name: "numa_other",
  168. DisplayName: "(integer, numa_other)",
  169. Unit: monitor.METRIC_UNIT_COUNT,
  170. },
  171. {
  172. Name: "nr_anon_transparent_hugepages",
  173. DisplayName: "(integer, nr_anon_transparent_hugepages)",
  174. Unit: monitor.METRIC_UNIT_COUNT,
  175. },
  176. {
  177. Name: "pgpgin",
  178. DisplayName: "(integer, pgpgin)",
  179. Unit: monitor.METRIC_UNIT_COUNT,
  180. },
  181. {
  182. Name: "pgpgout",
  183. DisplayName: "(integer, pgpgout)",
  184. Unit: monitor.METRIC_UNIT_COUNT,
  185. },
  186. {
  187. Name: "pswpin",
  188. DisplayName: "(integer, pswpin)",
  189. Unit: monitor.METRIC_UNIT_COUNT,
  190. },
  191. {
  192. Name: "pswpout",
  193. DisplayName: "(integer, pswpout)",
  194. Unit: monitor.METRIC_UNIT_COUNT,
  195. },
  196. {
  197. Name: "pgalloc_dma",
  198. DisplayName: "(integer, pgalloc_dma)",
  199. Unit: monitor.METRIC_UNIT_COUNT,
  200. },
  201. {
  202. Name: "pgalloc_dma32",
  203. DisplayName: "(integer, pgalloc_dma32)",
  204. Unit: monitor.METRIC_UNIT_COUNT,
  205. },
  206. {
  207. Name: "pgalloc_normal",
  208. DisplayName: "(integer, pgalloc_normal)",
  209. Unit: monitor.METRIC_UNIT_COUNT,
  210. },
  211. {
  212. Name: "pgalloc_movable",
  213. DisplayName: "(integer, pgalloc_movable)",
  214. Unit: monitor.METRIC_UNIT_COUNT,
  215. },
  216. {
  217. Name: "pgfree",
  218. DisplayName: "(integer, pgfree)",
  219. Unit: monitor.METRIC_UNIT_COUNT,
  220. },
  221. {
  222. Name: "pgactivate",
  223. DisplayName: "(integer, pgactivate)",
  224. Unit: monitor.METRIC_UNIT_COUNT,
  225. },
  226. {
  227. Name: "pgdeactivate",
  228. DisplayName: "(integer, pgdeactivate)",
  229. Unit: monitor.METRIC_UNIT_COUNT,
  230. },
  231. {
  232. Name: "pgfault",
  233. DisplayName: "(integer, pgfault)",
  234. Unit: monitor.METRIC_UNIT_COUNT,
  235. },
  236. {
  237. Name: "pgmajfault",
  238. DisplayName: "(integer, pgmajfault)",
  239. Unit: monitor.METRIC_UNIT_COUNT,
  240. },
  241. {
  242. Name: "pgrefill_dma",
  243. DisplayName: "(integer, pgrefill_dma)",
  244. Unit: monitor.METRIC_UNIT_COUNT,
  245. },
  246. {
  247. Name: "pgrefill_dma32",
  248. DisplayName: "(integer, pgrefill_dma32)",
  249. Unit: monitor.METRIC_UNIT_COUNT,
  250. },
  251. {
  252. Name: "pgrefill_normal",
  253. DisplayName: "(integer, pgrefill_normal)",
  254. Unit: monitor.METRIC_UNIT_COUNT,
  255. },
  256. {
  257. Name: "pgrefill_movable",
  258. DisplayName: "(integer, pgrefill_movable)",
  259. Unit: monitor.METRIC_UNIT_COUNT,
  260. },
  261. {
  262. Name: "pgsteal_dma",
  263. DisplayName: "(integer, pgsteal_dma)",
  264. Unit: monitor.METRIC_UNIT_COUNT,
  265. },
  266. {
  267. Name: "pgsteal_dma32",
  268. DisplayName: "(integer, pgsteal_dma32)",
  269. Unit: monitor.METRIC_UNIT_COUNT,
  270. },
  271. {
  272. Name: "pgsteal_normal",
  273. DisplayName: "(integer, pgsteal_normal)",
  274. Unit: monitor.METRIC_UNIT_COUNT,
  275. },
  276. {
  277. Name: "pgsteal_movable",
  278. DisplayName: "(integer, pgsteal_movable)",
  279. Unit: monitor.METRIC_UNIT_COUNT,
  280. },
  281. {
  282. Name: "pgscan_kswapd_dma",
  283. DisplayName: "(integer, pgscan_kswapd_dma)",
  284. Unit: monitor.METRIC_UNIT_COUNT,
  285. },
  286. {
  287. Name: "pgscan_kswapd_dma32",
  288. DisplayName: "(integer, pgscan_kswapd_dma32)",
  289. Unit: monitor.METRIC_UNIT_COUNT,
  290. },
  291. {
  292. Name: "pgscan_kswapd_normal",
  293. DisplayName: "(integer, pgscan_kswapd_normal)",
  294. Unit: monitor.METRIC_UNIT_COUNT,
  295. },
  296. {
  297. Name: "pgscan_kswapd_movable",
  298. DisplayName: "(integer, pgscan_kswapd_movable)",
  299. Unit: monitor.METRIC_UNIT_COUNT,
  300. },
  301. {
  302. Name: "pgscan_direct_dma",
  303. DisplayName: "(integer, pgscan_direct_dma)",
  304. Unit: monitor.METRIC_UNIT_COUNT,
  305. },
  306. {
  307. Name: "pgscan_direct_dma32",
  308. DisplayName: "(integer, pgscan_direct_dma32)",
  309. Unit: monitor.METRIC_UNIT_COUNT,
  310. },
  311. {
  312. Name: "pgscan_direct_normal",
  313. DisplayName: "(integer, pgscan_direct_normal)",
  314. Unit: monitor.METRIC_UNIT_COUNT,
  315. },
  316. {
  317. Name: "pgscan_direct_movable",
  318. DisplayName: "(integer, pgscan_direct_movable)",
  319. Unit: monitor.METRIC_UNIT_COUNT,
  320. },
  321. {
  322. Name: "zone_reclaim_failed",
  323. DisplayName: "(integer, zone_reclaim_failed)",
  324. Unit: monitor.METRIC_UNIT_COUNT,
  325. },
  326. {
  327. Name: "pginodesteal",
  328. DisplayName: "(integer, pginodesteal)",
  329. Unit: monitor.METRIC_UNIT_COUNT,
  330. },
  331. {
  332. Name: "slabs_scanned",
  333. DisplayName: "(integer, slabs_scanned)",
  334. Unit: monitor.METRIC_UNIT_COUNT,
  335. },
  336. {
  337. Name: "kswapd_steal",
  338. DisplayName: "(integer, kswapd_steal)",
  339. Unit: monitor.METRIC_UNIT_COUNT,
  340. },
  341. {
  342. Name: "kswapd_inodesteal",
  343. DisplayName: "(integer, kswapd_inodesteal)",
  344. Unit: monitor.METRIC_UNIT_COUNT,
  345. },
  346. {
  347. Name: "kswapd_low_wmark_hit_quickly",
  348. DisplayName: "(integer, kswapd_low_wmark_hit_quickly)",
  349. Unit: monitor.METRIC_UNIT_COUNT,
  350. },
  351. {
  352. Name: "kswapd_high_wmark_hit_quickly",
  353. DisplayName: "(integer, kswapd_high_wmark_hit_quickly)",
  354. Unit: monitor.METRIC_UNIT_COUNT,
  355. },
  356. {
  357. Name: "kswapd_skip_congestion_wait",
  358. DisplayName: "(integer, kswapd_skip_congestion_wait)",
  359. Unit: monitor.METRIC_UNIT_COUNT,
  360. },
  361. {
  362. Name: "pageoutrun",
  363. DisplayName: "(integer, pageoutrun)",
  364. Unit: monitor.METRIC_UNIT_COUNT,
  365. },
  366. {
  367. Name: "allocstall",
  368. DisplayName: "(integer, allocstall)",
  369. Unit: monitor.METRIC_UNIT_COUNT,
  370. },
  371. {
  372. Name: "pgrotated",
  373. DisplayName: "(integer, pgrotated)",
  374. Unit: monitor.METRIC_UNIT_COUNT,
  375. },
  376. {
  377. Name: "compact_blocks_moved",
  378. DisplayName: "(integer, compact_blocks_moved)",
  379. Unit: monitor.METRIC_UNIT_COUNT,
  380. },
  381. {
  382. Name: "compact_pages_moved",
  383. DisplayName: "(integer, compact_pages_moved)",
  384. Unit: monitor.METRIC_UNIT_COUNT,
  385. },
  386. {
  387. Name: "compact_pagemigrate_failed",
  388. DisplayName: "(integer, compact_pagemigrate_failed)",
  389. Unit: monitor.METRIC_UNIT_COUNT,
  390. },
  391. {
  392. Name: "compact_stall",
  393. DisplayName: "(integer, compact_stall)",
  394. Unit: monitor.METRIC_UNIT_COUNT,
  395. },
  396. {
  397. Name: "compact_fail",
  398. DisplayName: "(integer, compact_fail)",
  399. Unit: monitor.METRIC_UNIT_COUNT,
  400. },
  401. {
  402. Name: "compact_success",
  403. DisplayName: "(integer, compact_success)",
  404. Unit: monitor.METRIC_UNIT_COUNT,
  405. },
  406. {
  407. Name: "htlb_buddy_alloc_success",
  408. DisplayName: "(integer, htlb_buddy_alloc_success)",
  409. Unit: monitor.METRIC_UNIT_COUNT,
  410. },
  411. {
  412. Name: "htlb_buddy_alloc_fail",
  413. DisplayName: "(integer, htlb_buddy_alloc_fail)",
  414. Unit: monitor.METRIC_UNIT_COUNT,
  415. },
  416. {
  417. Name: "unevictable_pgs_culled",
  418. DisplayName: "(integer, unevictable_pgs_culled)",
  419. Unit: monitor.METRIC_UNIT_COUNT,
  420. },
  421. {
  422. Name: "unevictable_pgs_scanned",
  423. DisplayName: "(integer, unevictable_pgs_scanned)",
  424. Unit: monitor.METRIC_UNIT_COUNT,
  425. },
  426. {
  427. Name: "unevictable_pgs_rescued",
  428. DisplayName: "(integer, unevictable_pgs_rescued)",
  429. Unit: monitor.METRIC_UNIT_COUNT,
  430. },
  431. {
  432. Name: "unevictable_pgs_mlocked",
  433. DisplayName: "(integer, unevictable_pgs_mlocked)",
  434. Unit: monitor.METRIC_UNIT_COUNT,
  435. },
  436. {
  437. Name: "unevictable_pgs_munlocked",
  438. DisplayName: "(integer, unevictable_pgs_munlocked)",
  439. Unit: monitor.METRIC_UNIT_COUNT,
  440. },
  441. {
  442. Name: "unevictable_pgs_cleared",
  443. DisplayName: "(integer, unevictable_pgs_cleared)",
  444. Unit: monitor.METRIC_UNIT_COUNT,
  445. },
  446. {
  447. Name: "unevictable_pgs_stranded",
  448. DisplayName: "(integer, unevictable_pgs_stranded)",
  449. Unit: monitor.METRIC_UNIT_COUNT,
  450. },
  451. {
  452. Name: "unevictable_pgs_mlockfreed",
  453. DisplayName: "(integer, unevictable_pgs_mlockfreed)",
  454. Unit: monitor.METRIC_UNIT_COUNT,
  455. },
  456. {
  457. Name: "thp_fault_alloc",
  458. DisplayName: "(integer, thp_fault_alloc)",
  459. Unit: monitor.METRIC_UNIT_COUNT,
  460. },
  461. {
  462. Name: "thp_fault_fallback",
  463. DisplayName: "(integer, thp_fault_fallback)",
  464. Unit: monitor.METRIC_UNIT_COUNT,
  465. },
  466. {
  467. Name: "thp_collapse_alloc",
  468. DisplayName: "(integer, thp_collapse_alloc)",
  469. Unit: monitor.METRIC_UNIT_COUNT,
  470. },
  471. {
  472. Name: "thp_collapse_alloc_failed",
  473. DisplayName: "(integer, thp_collapse_alloc_failed)",
  474. Unit: monitor.METRIC_UNIT_COUNT,
  475. },
  476. {
  477. Name: "thp_split",
  478. DisplayName: "(integer, thp_split)",
  479. Unit: monitor.METRIC_UNIT_COUNT,
  480. },
  481. },
  482. }