4 Replies Latest reply on Jun 20, 2013 11:04 PM by John Sanda

    RHQ server displaying wrong value of measurement data in Summary tab

    prashant fulara Newbie

      The issue we are facing is with mesaurement data value greater than 10000000, for example if RHQ plugin provides value 13724813, it is shown in RHQ web page (localhost:7080) under summary tab as 13725000. I checked the database tables for RHQ RHQ_MEAS_DATA_NUM.. and they also have wrong valuw stored in them as 13725000.

       

      Following is the detail of our plugin:

       

      A RHQ plugin is written to moitor oracle10 database tabels. The code implements ResourceComponent and MeasurementFacet interfaces. Code runs a select count(*) query on a particular table and provide data using resultset.getLong(1) .  This value obtained is added to MeasurementReport as following:

               

                    Number value = new Long(dbConn.getValueFromDB());              

                    report.addData(new MeasurementDataNumeric(request, value.doubleValue()));

       

      The variable "value" is converted to type double before sending it.

       

      I tried to degug a bit and found that this value is converted to 1.3724813E7 and gets added to MeasurementReport object. And this same value is passed to the RHQ server in the report. It seesm RHQ server is doing some kind of formatting at its end.

       

      We are using RHQ 3.0.0. RHQ server is running on windows 64 bit and RHQ agent is runing on Solaris 64 bit.

       

      Please tell if there is any way to resolve this and what is the root cause for this behaviour.

        • 1. Re: RHQ server displaying wrong value of measurement data in Summary tab
          prashant fulara Newbie

          Following is the further analysis:

          1.      Data count is obtained from a DB table using  select count( * ) query. This returns a long value.  We fetch this value as getLong(1). We cannot change this. This seems oracle format

          2.       This value is then converted to double value in our plugin code. Here it is converted to exponential form.
          3.       This value is passed to RHQ Agent api. Value remains preserved but in exponential form
          4.       This value is finally passed to RHQ server
          5.       Now, here I see the problem.
                    a.      There are RHQ tables that store values of measurement data. With names like RHQ_MEAS_DATA_NUM_....
                    b.      Now the datatype of the column used to store value in these tables is FLOAT.
                    c.       This might be corrupting the values because double values in exponential form are stored in a column with Float as datatype.

           

           

          If the format of RHQ tables in latest version of RHQ remains same then this problem will exist.

           

          Did anyone face this issue? Can anyone confirm if same problem exist in latest versions? Is there any way to handle this?

          • 2. Re: RHQ server displaying wrong value of measurement data in Summary tab
            Lukas Krejci Apprentice

            Hello Prashant,

             

            while RHQ 3.0.0 is VERY old (we're close to releasing 4.8.0) this seems like a very serious issue. I am not sure if in your case a conversion long -> double -> float should cause any problems - the number in question is well within the range of all of them and even float should be able to handle that precision with no problems. That said, the type of the "value" column SHOULD be a DOUBLE on both Postgres and Oracle.

             

            I am more inclined to think that we might be (or might have been) doing some kind of rounding before the values are stored into the DB.

             

            In RHQ 4.8.0 we've completely revamped the metric storage for which we've started to use Cassandra cluster. That might or might not mean that your problem (if it existed in RHQ 4.x) might disappear

             

            In any case, since this looks quite serious, I would like to ask you to report this issue as a bug in our bugzilla here. It would be even better if you tried to reproduce your issue with RHQ 4.7.0 or even 4.8.0 once it gets out.

             

            Thanks for reporting this,

             

            Lukas

            1 of 1 people found this helpful
            • 3. Re: RHQ server displaying wrong value of measurement data in Summary tab
              prashant fulara Newbie

              Thanks Lukas for the reply. I will test the issue on RHQ 4.7 and report it as a bug if not solved on RHQ 4.7.

               

              When can we expect the release of RHQ 4.8, any idea?

              • 4. Re: RHQ server displaying wrong value of measurement data in Summary tab
                John Sanda Apprentice

                The release of RHQ 4.8.0 is imminent. We hope to have it out within the next day or two. Please stay tuned for the release announcement.