ping.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* Licensed to the public under the Apache License 2.0. */
  2. 'use strict';
  3. 'require baseclass';
  4. return baseclass.extend({
  5. title: _('Ping'),
  6. rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
  7. var ping = {
  8. title: "%H: ICMP Round Trip Time",
  9. vlabel: "ms",
  10. number_format: "%5.1lf ms",
  11. data: {
  12. sources: {
  13. ping: [ "value" ]
  14. },
  15. options: {
  16. ping__value: {
  17. noarea: true,
  18. overlay: true,
  19. title: "%di"
  20. }
  21. }
  22. }
  23. };
  24. var droprate = {
  25. title: "%H: ICMP Drop Rate",
  26. vlabel: "%",
  27. y_min: "0",
  28. y_max: "4",
  29. number_format: "%5.2lf %%",
  30. data: {
  31. types: [ "ping_droprate" ],
  32. options: {
  33. ping_droprate: {
  34. noarea: true,
  35. overlay: true,
  36. title: "%di",
  37. transform_rpn: "100,*"
  38. }
  39. }
  40. }
  41. };
  42. var stddev = {
  43. title: "%H: ICMP Standard Deviation",
  44. vlabel: "ms",
  45. y_min: "0",
  46. y_max: "1",
  47. number_format: "%5.1lf ms",
  48. data: {
  49. types: [ "ping_stddev" ],
  50. options: {
  51. ping_stddev: {
  52. noarea: true,
  53. overlay: true,
  54. title: "%di"
  55. }
  56. }
  57. }
  58. };
  59. return [ ping, droprate, stddev ];
  60. }
  61. });