Bug 1319019

Summary: Alert definition with conditions which are using threshold values for metrics with % as base unit created via REST are incorrectly displayed in UI
Product: [JBoss] JBoss Operations Network Reporter: Filip Brychta <fbrychta>
Component: REST, UIAssignee: Michael Burman <miburman>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: JON 3.3.5CC: jmartine, spinder
Target Milestone: ---   
Target Release: JON 3.3.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-02 15:29:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
screen shot none

Description Filip Brychta 2016-03-18 12:46:10 UTC
Created attachment 1137772 [details]
screen shot

Description of problem:
Condition with threshold value set to 4% is displayed as 400% in UI.

Version-Release number of selected component (if applicable):
JON3.3.5

How reproducible:
Always

Steps to Reproduce:
1. create following alert definition via rest:
curl -ivX POST -u rhqadmin:rhqadmin -H "Content-Type: application/json" -H "accept: application/json" -d '{"recoveryId": 0, "name": "Test alert", "conditionMode": "ANY", "enabled": true, "priority": "MEDIUM", "notifications": [{"config": {"emailAddress": "blabla"}, "senderName": "Direct Emails"}], "dampeningCategory": "NONE", "conditions": [{"category": "THRESHOLD", "threshold": 80, "measurementDefinition": 10027, "comparator": ">"}]}' fbr-jon330.bc.jonqe.lab.eng.bos.redhat.com:7080/rest/alert/definitions?resourceId=10001

Note that you need to change resourceId for your platform resourceId and measurementDefinition id must match System Load metrics and host must be changed as well.

This will create new alert definition
2. get the new alert definition:
curl -iv -u rhqadmin:rhqadmin -H "Content-Type: application/json" -H "accept: application/json" fbr-jon330.bc.jonqe.lab.eng.bos.redhat.com:7080/rest/alert/definition/10065

3. find the alert definition in UI and go to condition tab

Actual results:
After step 2:
{"id":10065,"name":"Test alert","enabled":true,"priority":"MEDIUM","recoveryId":0,"conditionMode":"ANY","conditions":[{"category":"THRESHOLD","id":10075,"threshold":80.0,"option":null,"triggerId":null,"comparator":">","measurementDefinition":10027,"name":"System Load"}],"notifications":[{"id":10025,"senderName":"Direct Emails","config":{"emailAddress":"blabla"},"extraConfig":{}}],"dampeningCategory":"NONE","dampeningCount":0,"dampeningPeriod":0,"dampeningUnit":null,"links":[{"coregui":{"href":"http://fbr-jon330.bc.jonqe.lab.eng.bos.redhat.com:7080/coregui/#Resource/10001/Alerts/Definitions/10065"}},{"resource":{"href":"http://fbr-jon330.bc.jonqe.lab.eng.bos.redhat.com:7080/rest/resource/10001"}}]}

threshold value is correctly shown as 80

After step 3 (see attached screen shot) threshold value is shown as 8000.0% which is incorrect


Expected results:
Threshold value should be correctly shown in UI.

Additional info:
This is not a regression, it's been there at least since JON3.2.3

Comment 4 Filip Brychta 2016-06-02 15:29:45 UTC
Triage: Larry, Simeon, Filip -> closing as not a bug. The behavior is expected.