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.ObjectRepresents a collection ofTelemetryinstances 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)booleanequals(java.lang.Object o)AttributesgetCommonAttributes()java.util.Collection<T>getTelemetry()java.util.UUIDgetUuid()booleanhasCommonAttributes()inthashCode()booleanisEmpty()intsize()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.StringtoString()
-
-
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-