rulesCheckerPolicies.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. var policies = {
  2. "metric1": {
  3. "tool": "tool1",
  4. "label": "The metric 1",
  5. "message": "A great message",
  6. "isOkThreshold": 1000,
  7. "isBadThreshold": 3000,
  8. "isAbnormalThreshold": 5000,
  9. "hasOffenders": false
  10. },
  11. "metric2": {
  12. "tool": "tool1",
  13. "label": "The metric 2",
  14. "message": "A great message",
  15. "isOkThreshold": 1000,
  16. "isBadThreshold": 3000,
  17. "isAbnormalThreshold": 5000,
  18. "takeOffendersFrom": "metric3",
  19. "hasOffenders": true,
  20. "offendersTransformFn": function(offenders) {
  21. return {
  22. count: 2,
  23. str: offenders.join(' - ')
  24. };
  25. }
  26. },
  27. "metric3": {
  28. "tool": "tool1",
  29. "label": "The metric 3",
  30. "message": "A great message",
  31. "isOkThreshold": 1000,
  32. "isBadThreshold": 3000,
  33. "isAbnormalThreshold": 5000,
  34. "hasOffenders": true,
  35. "offendersTransformFn": function(offenders) {
  36. return {
  37. count: 2,
  38. test: offenders.join('/')
  39. };
  40. }
  41. },
  42. "metric4": {
  43. "tool": "tool1",
  44. "label": "The metric 4",
  45. "message": "A great message",
  46. "isOkThreshold": 1000,
  47. "isBadThreshold": 3000,
  48. "isAbnormalThreshold": 5000,
  49. "hasOffenders": true,
  50. },
  51. "metric5": {
  52. "tool": "tool1",
  53. "label": "The metric 5",
  54. "message": "A great message",
  55. "isOkThreshold": 1000,
  56. "isBadThreshold": 3000,
  57. "isAbnormalThreshold": 5000,
  58. "hasOffenders": true,
  59. "takeOffendersFrom": ["metric3", "metric4"]
  60. },
  61. "metric6": {
  62. "tool": "tool1",
  63. "label": "The metric 6",
  64. "message": "A great message",
  65. "isOkThreshold": 1000,
  66. "isBadThreshold": 3000,
  67. "isAbnormalThreshold": 5000
  68. },
  69. "metric7": {
  70. "tool": "tool1",
  71. "label": "The metric 7",
  72. "message": "A great message",
  73. "isOkThreshold": 1000,
  74. "isBadThreshold": 3000,
  75. "isAbnormalThreshold": 5000
  76. },
  77. "metric10": {
  78. "tool": "tool2",
  79. "label": "The metric 10",
  80. "message": "<p>This is from another tool!</p>",
  81. "isOkThreshold": 0,
  82. "isBadThreshold": 3,
  83. "isAbnormalThreshold": 11,
  84. "hasOffenders": false,
  85. },
  86. "unexistantMetric": {
  87. "tool": "tool1",
  88. "label": "",
  89. "message": "",
  90. "isOkThreshold": 1000,
  91. "isBadThreshold": 3000,
  92. "isAbnormalThreshold": 5000,
  93. "hasOffenders": true
  94. },
  95. "unexistantTool": {
  96. "tool": "unexistant",
  97. "isOkThreshold": 1000,
  98. "isBadThreshold": 3000,
  99. "isAbnormalThreshold": 5000,
  100. "hasOffenders": false
  101. }
  102. };
  103. module.exports = policies;