Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Bug 1218129 - Calltime metrics sort does not work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben.vargas committed Mar 15, 2016
1 parent f0d02ed commit 9c19651
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -33,7 +33,6 @@
import org.rhq.core.domain.criteria.CallTimeDataCriteria;
import org.rhq.core.domain.measurement.MeasurementUnits;
import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite;
import org.rhq.core.domain.measurement.composite.MeasurementNumericValueAndUnits;
import org.rhq.core.domain.util.PageList;
import org.rhq.coregui.client.CoreGUI;
import org.rhq.coregui.client.gwt.GWTServiceLookup;
Expand Down Expand Up @@ -136,10 +135,10 @@ public ListGridRecord copyValues(CallTimeDataComposite from) {
double[] durations = new double[] { from.getMinimum(), from.getMaximum(), from.getAverage() };
String[] durationStrings = MeasurementConverterClient.formatToSignificantPrecision(durations,
MeasurementUnits.MILLISECONDS, true);

// total is the sum of all calls so we format it differently as min, max because it is
// much higher number
MeasurementNumericValueAndUnits total = MeasurementConverterClient.fit(from.getTotal(),
MeasurementUnits.MILLISECONDS);

String totalString = MeasurementConverterClient.format(from.getTotal(), MeasurementUnits.MILLISECONDS, true);

ListGridRecord record = new ListGridRecord();
Expand All @@ -148,7 +147,7 @@ public ListGridRecord copyValues(CallTimeDataComposite from) {
record.setAttribute(FIELD_MIN, durations[0]);
record.setAttribute(FIELD_MAX, durations[1]);
record.setAttribute(FIELD_AVG, durations[2]);
record.setAttribute(FIELD_TOTAL, total.getValue());
record.setAttribute(FIELD_TOTAL, from.getTotal());
record.setAttribute(FIELD_MIN_STRING, durationStrings[0]);
record.setAttribute(FIELD_MAX_STRING, durationStrings[1]);
record.setAttribute(FIELD_AVG_STRING, durationStrings[2]);
Expand Down

0 comments on commit 9c19651

Please sign in to comment.