processes.lua 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org>
  2. -- Licensed to the public under the Apache License 2.0.
  3. module("luci.statistics.rrdtool.definitions.processes", package.seeall)
  4. function rrdargs( graph, plugin, plugin_instance, dtype )
  5. return {
  6. {
  7. title = "%H: Processes",
  8. vlabel = "Processes/s",
  9. data = {
  10. instances = {
  11. ps_state = {
  12. "sleeping", "running", "paging", "blocked", "stopped", "zombies"
  13. }
  14. },
  15. options = {
  16. ps_state_sleeping = { color = "0000ff" },
  17. ps_state_running = { color = "008000" },
  18. ps_state_paging = { color = "ffff00" },
  19. ps_state_blocked = { color = "ff5000" },
  20. ps_state_stopped = { color = "555555" },
  21. ps_state_zombies = { color = "ff0000" }
  22. }
  23. }
  24. },
  25. {
  26. title = "%H: CPU time used by %pi",
  27. vlabel = "Jiffies",
  28. data = {
  29. sources = {
  30. ps_cputime = { "syst", "user" }
  31. },
  32. options = {
  33. ps_cputime__user = {
  34. color = "0000ff",
  35. overlay = true
  36. },
  37. ps_cputime__syst = {
  38. color = "ff0000",
  39. overlay = true
  40. }
  41. }
  42. }
  43. },
  44. {
  45. title = "%H: Threads and processes belonging to %pi",
  46. vlabel = "Count",
  47. detail = true,
  48. data = {
  49. sources = {
  50. ps_count = { "threads", "processes" }
  51. },
  52. options = {
  53. ps_count__threads = { color = "00ff00" },
  54. ps_count__processes = { color = "0000bb" }
  55. }
  56. }
  57. },
  58. {
  59. title = "%H: Page faults in %pi",
  60. vlabel = "Pagefaults",
  61. detail = true,
  62. data = {
  63. sources = {
  64. ps_pagefaults = { "minflt", "majflt" }
  65. },
  66. options = {
  67. ps_pagefaults__minflt = { color = "ff0000" },
  68. ps_pagefaults__majflt = { color = "ff5500" }
  69. }
  70. }
  71. },
  72. {
  73. title = "%H: Virtual memory size of %pi",
  74. vlabel = "Bytes",
  75. detail = true,
  76. number_format = "%5.1lf%sB",
  77. data = {
  78. types = { "ps_rss" },
  79. options = {
  80. ps_rss = { color = "0000ff" }
  81. }
  82. }
  83. }
  84. }
  85. end