iwinfo.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. -- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
  2. -- Licensed to the public under the Apache License 2.0.
  3. module("luci.statistics.rrdtool.definitions.iwinfo", package.seeall)
  4. function rrdargs( graph, plugin, plugin_instance )
  5. --
  6. -- signal/noise diagram
  7. --
  8. local snr = {
  9. title = "%H: Signal and noise on %pi",
  10. vlabel = "dBm",
  11. number_format = "%5.1lf dBm",
  12. data = {
  13. types = { "signal_noise", "signal_power" },
  14. options = {
  15. signal_power = {
  16. title = "Signal",
  17. overlay = true,
  18. color = "0000ff"
  19. },
  20. signal_noise = {
  21. title = "Noise",
  22. overlay = true,
  23. color = "ff0000"
  24. }
  25. }
  26. }
  27. }
  28. --
  29. -- signal quality diagram
  30. --
  31. local quality = {
  32. title = "%H: Signal quality on %pi",
  33. vlabel = "Quality",
  34. number_format = "%3.0lf",
  35. data = {
  36. types = { "signal_quality" },
  37. options = {
  38. signal_quality = {
  39. title = "Quality",
  40. noarea = true,
  41. color = "0000ff"
  42. }
  43. }
  44. }
  45. }
  46. --
  47. -- phy rate diagram
  48. --
  49. local bitrate = {
  50. title = "%H: Average phy rate on %pi",
  51. vlabel = "MBit/s",
  52. number_format = "%5.1lf%sBit/s",
  53. data = {
  54. types = { "bitrate" },
  55. options = {
  56. bitrate = {
  57. title = "Rate",
  58. color = "00ff00"
  59. }
  60. }
  61. }
  62. }
  63. --
  64. -- associated stations
  65. --
  66. local stations = {
  67. title = "%H: Associated stations on %pi",
  68. vlabel = "Stations",
  69. y_min = "0",
  70. alt_autoscale_max = true,
  71. number_format = "%3.0lf",
  72. data = {
  73. types = { "stations" },
  74. options = {
  75. stations = {
  76. title = "Stations",
  77. color = "0000ff"
  78. }
  79. }
  80. }
  81. }
  82. return { snr, quality, bitrate, stations }
  83. end