Package com.newrelic.telemetry
Class TelemetryBatch<T extends Telemetry>
- java.lang.Object
-
- com.newrelic.telemetry.TelemetryBatch<T>
-
- Direct Known Subclasses:
EventBatch
,LogBatch
,MetricBatch
,SpanBatch
public abstract class TelemetryBatch<T extends Telemetry> extends java.lang.Object
Represents a collection ofTelemetry
instances and some common attributes
-
-
Constructor Summary
Constructors Constructor Description TelemetryBatch(java.util.Collection<T> telemetry, Attributes commonAttributes)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract TelemetryBatch<T>
createSubBatch(java.util.Collection<T> telemetry)
boolean
equals(java.lang.Object o)
Attributes
getCommonAttributes()
java.util.Collection<T>
getTelemetry()
java.util.UUID
getUuid()
boolean
hasCommonAttributes()
int
hashCode()
boolean
isEmpty()
int
size()
Returns the number of telemetry items in this collection.java.util.List<TelemetryBatch<T>>
split()
Split this batch into 2 roughly equal pieces.java.lang.String
toString()
-
-
-
Constructor Detail
-
TelemetryBatch
public TelemetryBatch(java.util.Collection<T> telemetry, Attributes commonAttributes)
-
-
Method Detail
-
split
public java.util.List<TelemetryBatch<T>> split()
Split this batch into 2 roughly equal pieces. If the initial batch contains no telemetry, this will simply return an empty list of batches.- Returns:
- a List of telemetry batches, roughly split in 2.
-
size
public int size()
Returns the number of telemetry items in this collection. If this batch contains more than {Integer.MAX_VALUE} items, returns {Integer.MAX_VALUE}.- Returns:
- the number of telemetry items in this batch
-
hasCommonAttributes
public boolean hasCommonAttributes()
- Returns:
- true if the common attributes are not empty
-
isEmpty
public boolean isEmpty()
-
createSubBatch
public abstract TelemetryBatch<T> createSubBatch(java.util.Collection<T> telemetry)
-
getTelemetry
public java.util.Collection<T> getTelemetry()
-
getCommonAttributes
public Attributes getCommonAttributes()
-
getUuid
public java.util.UUID getUuid()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-