Separate offender analyze, parsing in the core, display in the front

This commit is contained in:
Gaël Métais
2015-01-26 11:34:38 +01:00
parent d829525ab8
commit 901116fde6
17 changed files with 1436 additions and 563 deletions
+26 -10
View File
@@ -6,7 +6,8 @@
"message": "A great message",
"isOkThreshold": 1000,
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000
"isAbnormalThreshold": 5000,
"hasOffenders": false
},
"value": 1236,
"bad": true,
@@ -22,11 +23,14 @@
"isOkThreshold": 1000,
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000,
"hasOffenders": true,
"takeOffendersFrom": "metric3"
},
"value": 222,
"offenders": "offender1 - offender2",
"offendersCount": 2,
"offendersObj": {
"count": 2,
"str": "offender1 - offender2"
},
"bad": false,
"abnormal": false,
"score": 100,
@@ -39,11 +43,14 @@
"message": "A great message",
"isOkThreshold": 1000,
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000
"isAbnormalThreshold": 5000,
"hasOffenders": true
},
"value": 6666,
"offenders": "offender1/offender2",
"offendersCount": 2,
"offendersObj": {
"count": 2,
"test": "offender1/offender2"
},
"bad": true,
"abnormal": true,
"score": 0,
@@ -56,10 +63,14 @@
"message": "A great message",
"isOkThreshold": 1000,
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000
"isAbnormalThreshold": 5000,
"hasOffenders": true
},
"value": 1000,
"offenders": ["offender3"],
"offendersObj": {
"count": 1,
"list": ["offender3"]
},
"bad": false,
"abnormal": false,
"score": 100,
@@ -73,10 +84,14 @@
"isOkThreshold": 1000,
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000,
"hasOffenders": true,
"takeOffendersFrom": ["metric3", "metric4"]
},
"value": 3000,
"offenders": ["offender1", "offender2", "offender3"],
"offendersObj": {
"count": 3,
"list": ["offender1", "offender2", "offender3"]
},
"bad": true,
"abnormal": false,
"score": 0,
@@ -120,7 +135,8 @@
"message": "<p>This is from another tool!</p>",
"isOkThreshold": 0,
"isBadThreshold": 3,
"isAbnormalThreshold": 11
"isAbnormalThreshold": 11,
"hasOffenders": false
},
"value": 22,
"bad": true,
+21 -7
View File
@@ -6,7 +6,8 @@ var policies = {
"message": "A great message",
"isOkThreshold": 1000,
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000
"isAbnormalThreshold": 5000,
"hasOffenders": false
},
"metric2": {
"tool": "tool1",
@@ -16,8 +17,12 @@ var policies = {
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000,
"takeOffendersFrom": "metric3",
"hasOffenders": true,
"offendersTransformFn": function(offenders) {
return offenders.join(' - ');
return {
count: 2,
str: offenders.join(' - ')
};
}
},
"metric3": {
@@ -27,8 +32,12 @@ var policies = {
"isOkThreshold": 1000,
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000,
"hasOffenders": true,
"offendersTransformFn": function(offenders) {
return offenders.join('/');
return {
count: 2,
test: offenders.join('/')
};
}
},
"metric4": {
@@ -37,7 +46,8 @@ var policies = {
"message": "A great message",
"isOkThreshold": 1000,
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000
"isAbnormalThreshold": 5000,
"hasOffenders": true,
},
"metric5": {
"tool": "tool1",
@@ -46,6 +56,7 @@ var policies = {
"isOkThreshold": 1000,
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000,
"hasOffenders": true,
"takeOffendersFrom": ["metric3", "metric4"]
},
"metric6": {
@@ -71,7 +82,8 @@ var policies = {
"message": "<p>This is from another tool!</p>",
"isOkThreshold": 0,
"isBadThreshold": 3,
"isAbnormalThreshold": 11
"isAbnormalThreshold": 11,
"hasOffenders": false,
},
"unexistantMetric": {
@@ -80,13 +92,15 @@ var policies = {
"message": "",
"isOkThreshold": 1000,
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000
"isAbnormalThreshold": 5000,
"hasOffenders": true
},
"unexistantTool": {
"tool": "unexistant",
"isOkThreshold": 1000,
"isBadThreshold": 3000,
"isAbnormalThreshold": 5000
"isAbnormalThreshold": 5000,
"hasOffenders": false
}
};