Red Hat Bugzilla – Bug 698600
Can not enter metric for alert definition that has a unit
Last modified: 2013-09-02 03:23:27 EDT
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.
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.
I wonder if this has implications for existing alerts too? Lets try to fix this.
(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
*** Bug 668607 has been marked as a duplicate of this bug. ***
See 668607 for an example of other unit issues
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
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.
*** Bug 743697 has been marked as a duplicate of this bug. ***
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.