public class HistogramRecord extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static Comparator<HistogramRecord> |
COMPARATOR_FOR_LABEL |
static Comparator<HistogramRecord> |
COMPARATOR_FOR_NUMBEROFOBJECTS |
static Comparator<HistogramRecord> |
COMPARATOR_FOR_RETAINEDHEAPSIZE |
static Comparator<HistogramRecord> |
COMPARATOR_FOR_USEDHEAPSIZE |
Constructor and Description |
---|
HistogramRecord(String label)
Create histogram record just with a label identifying it.
|
HistogramRecord(String label,
long numberOfObjects,
long usedHeapSize,
long retainedHeapSize)
Create histogram record with a label identifying it and its basic data.
|
Modifier and Type | Method and Description |
---|---|
String |
getLabel()
Get label identifying the histogram record.
|
long |
getNumberOfObjects()
Get number of objects this histogram record stands for.
|
long |
getRetainedHeapSize()
Get number of retained bytes in heap area this histogram record stands
for.
|
long |
getUsedHeapSize()
Get number of bytes in heap area this histogram record stands for.
|
void |
incNumberOfObjects()
Increment number of objects this histogram record stands for by 1.
|
void |
incNumberOfObjects(long inc)
Increment number of objects this histogram record stands for.
|
void |
incRetainedHeapSize(long inc) |
void |
incUsedHeapSize(long inc)
Increment number of bytes in heap area this histogram record stands for.
|
static Comparator<HistogramRecord> |
reverseComparator(Comparator<HistogramRecord> comparator)
Convenience method reversing the order of the given comparator.
|
void |
setLabel(String label)
Set label identifying the histogram record.
|
void |
setNumberOfObjects(long numberOfObjects)
Set number of objects this histogram record stands for.
|
void |
setRetainedHeapSize(long retainedHeapSize)
Set number of retained bytes in heap area this histogram record stands
for.
|
void |
setUsedHeapSize(long usedHeapSize)
Set number of bytes in heap area this histogram record stands for.
|
public static final Comparator<HistogramRecord> COMPARATOR_FOR_LABEL
public static final Comparator<HistogramRecord> COMPARATOR_FOR_NUMBEROFOBJECTS
public static final Comparator<HistogramRecord> COMPARATOR_FOR_USEDHEAPSIZE
public static final Comparator<HistogramRecord> COMPARATOR_FOR_RETAINEDHEAPSIZE
public HistogramRecord(String label)
label
- label identifying the histogram recordpublic HistogramRecord(String label, long numberOfObjects, long usedHeapSize, long retainedHeapSize)
label
- label identifying the histogram recordnumberOfObjects
- number of objects this histogram record stands forusedHeapSize
- number of bytes in heap area this histogram record stands forpublic String getLabel()
public void setLabel(String label)
label
- label identifying the histogram recordpublic long getNumberOfObjects()
public void setNumberOfObjects(long numberOfObjects)
numberOfObjects
- number of objects this histogram record stands forpublic void incNumberOfObjects()
public void incNumberOfObjects(long inc)
inc
- number of objects by which the number of objects should be
incrementedpublic long getUsedHeapSize()
public void setUsedHeapSize(long usedHeapSize)
usedHeapSize
- number of bytes in heap area this histogram record stands forpublic void incUsedHeapSize(long inc)
inc
- number of bytes by which the number of bytes in heap area
should be incrementedpublic long getRetainedHeapSize()
Retained bytes means how much memory would be garbage collected if the references to the objects this histogram record stands for would be lost and the objects garbage collected.
public void setRetainedHeapSize(long retainedHeapSize)
Retained bytes means how much memory would be garbage collected if the references to the objects this histogram record stands for would be lost and the objects garbage collected.
retainedHeapSize
- number of retained bytes in heap area this histogram record
stands forpublic void incRetainedHeapSize(long inc)
public static Comparator<HistogramRecord> reverseComparator(Comparator<HistogramRecord> comparator)
List.get(int)
is
anyhow faster compared to an Iterator
.comparator
- comparator for which a reversed comparator should be returned