* Bernd Hufmann - Added setter and getter and bar width support
* Francois Chouinard - Moved from LTTng to TMF
* Patrick Tasse - Support selection range
+ * Jean-Christian Kouamé - Support to manage lost events
*******************************************************************************/
package org.eclipse.linuxtools.tmf.ui.views.histogram;
* Array of scaled values
*/
public int[] fData;
+ /**
+ * Array of scaled values combined including the lost events.
+ * This array contains the number of lost events for each bar in the histogram
+ * @since 2.1
+ */
+ public final int[] fLostEventsData;
/**
* The bucket duration of a scaled data bucket.
*/
* The maximum number of events of all buckets.
*/
public long fMaxValue;
+ /**
+ * the maximum of events of all buckets including the lost events
+ * @since 2.1
+ */
+ public long fMaxCombinedValue;
/**
* The index of the current bucket.
*/
* The scaling factor used to fill the scaled data.
*/
public double fScalingFactor;
+ /**
+ * The scaling factor used to fill the scaled data including the lost events.
+ * @since 2.1
+ */
+ public double fScalingFactorCombined;
+ /**
+ * The scaling factor used to fill the combining scaled data including lost events
+ */
/**
* Time of first bucket.
*/
* The time of the first event.
*/
public long fFirstEventTime;
-
+ /**
+ * show the lost events or not
+ * @since 2.1
+ */
+ public static volatile boolean hideLostEvents = false;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
fWidth = width;
fHeight = height;
fBarWidth = barWidth;
- fData = new int[width/fBarWidth];
- Arrays.fill(fData, 0);
+ fData = new int[width / fBarWidth];
+ fLostEventsData = new int[width / fBarWidth];
fBucketDuration = 1;
fMaxValue = 0;
+ fMaxCombinedValue = 0;
fSelectionBeginBucket = 0;
fSelectionEndBucket = 0;
fLastBucket = 0;
fScalingFactor = 1;
+ fScalingFactorCombined = 1;
fFirstBucketTime = 0;
}
fWidth = other.fWidth;
fHeight = other.fHeight;
fBarWidth = other.fBarWidth;
- fData = Arrays.copyOf(other.fData, fWidth);
+ fData = Arrays.copyOf(other.fData, other.fData.length);
+ fLostEventsData = Arrays.copyOf(other.fLostEventsData, other.fLostEventsData.length);
fBucketDuration = other.fBucketDuration;
fMaxValue = other.fMaxValue;
+ fMaxCombinedValue = other.fMaxCombinedValue;
fSelectionBeginBucket = other.fSelectionBeginBucket;
fSelectionEndBucket = other.fSelectionEndBucket;
fLastBucket = other.fLastBucket;
fScalingFactor = other.fScalingFactor;
+ fScalingFactorCombined = other.fScalingFactorCombined;
fFirstBucketTime = other.fFirstBucketTime;
}
public long getBucketEndTime(int index) {
return getBucketStartTime(index) + fBucketDuration;
}
-}
\ No newline at end of file
+}