|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensolaris.os.dtrace.Aggregate
public final class Aggregate
A consistent snapshot of all aggregations requested by a single
Consumer
.
Immutable. Supports persistence using XMLEncoder
.
Consumer.getAggregate()
,
Serialized FormConstructor Summary | |
---|---|
Aggregate(long snaptimeNanos,
java.util.Collection<Aggregation> aggregations)
Creates an aggregate with the given snaptime and aggregations. |
Method Summary | |
---|---|
java.util.Map<java.lang.String,Aggregation> |
asMap()
Gets a read-only Map view of this aggregate. |
Aggregation |
getAggregation(java.lang.String name)
Gets the aggregation with the given name if it exists in this aggregate snapshot. |
java.util.List<Aggregation> |
getAggregations()
Gets an unordered list of all aggregations in this aggregate snapshot. |
java.util.List<AggregationRecord> |
getOrderedRecords()
Gets an ordered list of this aggregate's records sequenced by their ordinal property. |
java.util.List<AggregationRecord> |
getRecords()
Gets an unordered list of this aggregate's records. |
long |
getSnaptime()
Gets the nanosecond timestamp of this aggregate snapshot. |
java.lang.String |
toString()
Gets a string representation of this aggregate snapshot useful for logging and not intended for display. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Aggregate(long snaptimeNanos, java.util.Collection<Aggregation> aggregations)
snaptimeNanos
- nanosecond timestamp when this aggregate was
snappedaggregations
- unordered collection of aggregations
belonging to this aggregate
java.lang.NullPointerException
- if the given collection of
aggregations is null
java.lang.IllegalArgumentException
- if the record ordinals of the
given aggregations are invalidMethod Detail |
---|
public long getSnaptime()
public java.util.List<Aggregation> getAggregations()
Collections.sort(List list, Comparator c)
provided any
user-defined ordering. Modifying the returned list has no effect
on this aggregate. Supports XML persistence.
public Aggregation getAggregation(java.lang.String name)
name
- the name of the desired aggregation, or empty string
to request the unnamed aggregation. In D, the unnamed
aggregation is used anytime a name does not follow the
aggregation symbol '@
', for example:
@ = count();
as opposed to
@counts = count()
resulting in an
Aggregation
with the name "counts".
null
if no aggregation by the given name exists
in this aggregateAggregation.getName()
public java.util.List<AggregationRecord> getRecords()
Collections.sort(List list,
Comparator c)
with any user-defined ordering. Modifying the
returned list has no effect on this aggregate.
public java.util.List<AggregationRecord> getOrderedRecords()
ordinal
property.
Note that the unordered list returned by getRecords()
can easily be sorted by any arbitrary criteria, for example by
key ascending:
List records = aggregate.getRecords();
Collections.sort(records, new Comparator <AggregationRecord> () {
public int compare(AggregationRecord r1, AggregationRecord r2) {
return r1.getTuple().compareTo(r2.getTuple());
}
});
Use getOrderedRecords()
instead of getRecords()
when you want to list records as they would be ordered by dtrace(1M)
.
public java.util.Map<java.lang.String,Aggregation> asMap()
Map
view of this aggregate.
Map
view of this aggregate keyed by
aggregation namepublic java.lang.String toString()
class-name[property1 = value1, property2 = value2]
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |