|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensolaris.os.dtrace.Aggregation
public final class Aggregation
A snapshot of a DTrace aggregation. The name of an Aggregation
instance matches the source declaration, for example
@a[execname] = count();
results in an Aggregation
named "a" (the name does not
include the preceding @
). For convenience, a single
aggregation can remain unnamed (multiple aggregations in the same D
program need distinct names). The unnamed aggregation results in an
Aggregation
instance whose name is the empty string, for
example
@[execname] = count();
An aggregation can list more than one variable in square brackets in
order to accumulate a value for each unique combination, or Tuple
. Each tuple instance is associated with its accumulated
AggregationValue
in an AggregationRecord
. For
example
@counts[execname, probefunc, cpu] = count();
results in an Aggregation
named "counts" containing records
each pairing a CountValue
to a three-element Tuple
.
It is also possible to omit the square brackets, for example
@a = count();
results in an Aggregation
named "a" with only a single record
keyed to the empty tuple (Tuple.EMPTY
).
For more information, see the
Aggregations chapter of the Solaris Dynamic Tracing
Guide. Also, the
Built-in Variables section of the Variables chapter
describes variables like execname
, probefunc
, and
cpu
useful for aggregating.
Immutable. Supports persistence using XMLEncoder
.
Aggregate
,
PrintaRecord
,
Serialized FormConstructor Summary | |
---|---|
Aggregation(java.lang.String aggregationName,
long aggregationID,
java.util.Collection<AggregationRecord> aggregationRecords)
Creates an aggregation with the given name, ID, and records. |
Method Summary | |
---|---|
java.util.Map<Tuple,AggregationRecord> |
asMap()
Gets a read-only Map view of this aggregation. |
boolean |
equals(java.lang.Object o)
Compares the specified object with this aggregation for equality. |
long |
getID()
Gets the D compiler-generated ID of this aggregation. |
java.lang.String |
getName()
Gets the name of this aggregation. |
AggregationRecord |
getRecord(Tuple key)
Gets the record associated with the given key, or the singleton record of an aggregation declared without square brackets if key is null or empty. |
java.util.List<AggregationRecord> |
getRecords()
Gets an unordered list of this aggregation's records. |
int |
hashCode()
Overridden to ensure that equal aggregations have equal hash codes. |
java.lang.String |
toString()
Gets a string representation of this aggregation useful for logging and not intended for display. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Aggregation(java.lang.String aggregationName, long aggregationID, java.util.Collection<AggregationRecord> aggregationRecords)
aggregationName
- the name of this aggregation, empty string
if this aggregation is unnamedaggregationID
- ID generated from a sequence by the native
DTrace libraryaggregationRecords
- unordered collection of records
belonging to this aggregation
java.lang.NullPointerException
- if the specified name or list of
records is null
java.lang.IllegalArgumentException
- if any record has an empty
tuple, unless it is the only record in the given collection (only
a singleton generated by an aggregation without square brackets
uses Tuple.EMPTY
as a key)getRecord(Tuple key)
Method Detail |
---|
public java.lang.String getName()
@
, or an empty string if
the aggregation is unnamed, for example:
@[execname] = count();
public long getID()
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 aggregation. Supports XML
persistence.
Aggregate.getRecords()
,
Aggregate.getOrderedRecords()
public java.util.Map<Tuple,AggregationRecord> asMap()
Map
view of this aggregation.
Map
view of this aggregationpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
true
if and only if the specified object is an
Aggregation
with the same name as this aggregation and
the Map
views of both aggregations returned by asMap()
are equal as defined by AbstractMap.equals()
public int hashCode()
hashCode
in class java.lang.Object
public AggregationRecord getRecord(Tuple key)
key
is null
or empty.
key
- The record key, or an empty tuple (see Tuple.EMPTY
) to obtain the value from a singleton (a
non-keyed instance with only a single value) generated from a
DTrace aggregation declarated without square brackets, for
example:
@a = count();
null
if no record in this aggregation is associated with the given keypublic 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 |