Bug 698600

Summary: Can not enter metric for alert definition that has a unit
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: Core UI, AlertsAssignee: John Mazzitelli <mazz>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: high    
Version: 4.0.0.Beta2CC: hrupp, jshaughn, mazz, rsoares, skondkar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-02 07:23:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 585306, 625146    
Attachments:
Description Flags
Screen shot fo input box none

Description Heiko W. Rupp 2011-04-21 11:15:03 UTC
Go to platform, add a new alert definition.
Add a condition "Free memory < 3GB"  (see screenshot).

A red dot appears, where the hover says "must be a valid decimal".

This is a clear regression to RHQ 3 and cumbersome for users to enter correctly,
when they first have to pull out a pocket calculator to translate 3gb to bytes (= 3221225472 )

The list view after entry correctly shows the 3gb then.

Comment 1 Heiko W. Rupp 2011-04-21 11:17:18 UTC
Created attachment 493787 [details]
Screen shot fo input box

ah and the ok button is not marked as disabled when the red dot is shown or no value has been entered at all.

Comment 2 Charles Crouch 2011-04-21 13:07:22 UTC
I wonder if this has implications for existing alerts too? Lets try to fix this.

Comment 3 Charles Crouch 2011-04-21 15:07:45 UTC
(9:57:52 AM) mazz: this is a known issue and quite possibly is a duplicate
(9:57:59 AM) mazz: you can't enter units
(9:58:07 AM) mazz: you have to enter just the raw number in bytes
(9:59:34 AM) ccrouch: mazz: what about existing data?
(9:59:56 AM) mazz: what do you mean "existing data"?
(10:00:19 AM) ccrouch: i created an alert using a version of RHQ which does allow you to enter units
(10:01:00 AM) pilhuhn: ccrouch I can do that too by going to the JSF UI :-)
(10:02:05 AM) ccrouch: pilhuhn: right thats what i meant alerts created in rhq3
(10:02:41 AM) mazz: that shouldn't matter
(10:02:43 AM) pilhuhn: ccrouch when you enter the 3GB as 3221225472 , the GWT ui will correctly display it as such later
(10:02:49 AM) mazz: the UI would have to convert it to the base units anyway
(10:02:57 AM) mazz: we wouldn't store "10GB" in the Db
(10:03:03 AM) mazz: it would be something like 10000000000
(10:03:22 AM) ccrouch: gotya
(10:03:31 AM) mazz: this is just a convience from a UI perspective, allowing the user to specify the units in which case we'd convert to the base units and store the number
(10:04:00 AM) pilhuhn: Users expect to be able to enter 3.5GB and not search for a desk calculator in order to find the number of bytes in 3.5GB
(10:04:23 AM) mazz: I could've sworn we had a BZ on this already, but I can't find it (go figure, I can't find anything in BZ) so I'll assume one didn't exist until this one pilhuhn entered
(10:04:27 AM) pilhuhn: This is a usability issue
(10:04:30 AM) ccrouch: mazz: i'm less concerned if we're doing the right thing in the DB
(10:04:44 AM) ccrouch: though i agree its not helpful as pilhuhn points out
(10:04:44 AM) pilhuhn: mazz I also recalled that - perhaps we only chatted a long time ago
(10:05:09 AM) ccrouch: we need to fix this, but its not a blocker
(10:05:11 AM) mazz: of course - obviously we'll need to address this at some point.
(10:05:19 AM) ccrouch: i'm going to drop the priority

Comment 4 Charles Crouch 2011-08-12 16:34:38 UTC
*** Bug 668607 has been marked as a duplicate of this bug. ***

Comment 5 Charles Crouch 2011-08-12 16:35:08 UTC
See 668607 for an example of other unit issues

Comment 6 John Mazzitelli 2011-09-15 05:24:20 UTC
this was a pretty bad UI problem that has been around long enough.

main commit: a4122c29a8788b93f85f5a97e8f3895bb89aa028
minor NPE check commit: 1a667256e025ccfc134528613dae82625d0cc1a9

to test, just create any number of alert conditions for many different metrics and see that you can use the different units (MB, GB, TB, ms, s, m, h, d, etc. etc. etc). for percentages, you can now optionally use "%", too.

When you save the alert definition to the DB, navigate away from the definition view then go back to it (to force a different code path to trigger - this will re-load the alert def and all conditions from the DB) and make sure the alert conditions show up properly in the conditions subtab of the alert definition editor view.

The text fields will validate as you type. So the red "error" indicator will show up if the value is invalid at any time for the particular metric selected

Comment 7 Sunil Kondkar 2011-09-26 11:17:50 UTC
Verified on build#426 (Version: 4.1.0-SNAPSHOT Build Number: 7739090)

Created alert conditions for metrics like JVM Free Memory and verified that units B, MB, GB, TB can be used and saved. Verified that for metrics like 'Avg Execution Time Commands Received Successfully', units like ms, s, m, h, d can be used. Also created alerts conditions for metrics like 'system load', using "%".

Verified that after navigating away from the alert definition view and coming back, the alert condition is displayed properly.

The red error indicator is shown if invalid value is entered in the text fields for the selected metric.

Comment 8 Heiko W. Rupp 2011-10-06 07:04:06 UTC
*** Bug 743697 has been marked as a duplicate of this bug. ***

Comment 9 Heiko W. Rupp 2013-09-02 07:23:27 UTC
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.