Package codes.grow.packages.datadoglogs
Record Class DatadogCompute
java.lang.Object
java.lang.Record
codes.grow.packages.datadoglogs.DatadogCompute
- Record Components:
aggregation-count,cardinality,pc75…pc99,sum,min,max,avgormediantype-total(default) ortimeseriesinterval- time bucket fortimeseries, e.g.5mmetric- measure for non-count aggregations, e.g.@duration
public record DatadogCompute(String aggregation, String type, Optional<String> interval, Optional<String> metric)
extends Record
One computation of
DatadogLogsQuery.aggregateLogs(java.util.List<codes.grow.packages.datadoglogs.DatadogCompute>, java.util.List<codes.grow.packages.datadoglogs.DatadogGroupBy>, codes.grow.packages.datadoglogs.AggregateLogsOptions); results are keyed c0,
c1, … in order.
DatadogCompute.of("count");
DatadogCompute.of("avg").withMetric("@duration");
DatadogCompute.of("count").timeseries("5m");
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaggregationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.interval()Returns the value of theintervalrecord component.metric()Returns the value of themetricrecord component.static DatadogComputeAtotalcompute.timeseries(String interval) Returns a copy as a timeseries with the given bucket interval.final StringtoString()Returns a string representation of this record class.toWire()Returns the wire form.type()Returns the value of thetyperecord component.withMetric(String metric) Returns a copy with a measure.
-
Constructor Details
-
DatadogCompute
public DatadogCompute(String aggregation, String type, Optional<String> interval, Optional<String> metric) Creates a compute.- Parameters:
aggregation- aggregation function (required)type-totalortimeseries; null meanstotalinterval- bucket intervalmetric- measure- Throws:
ValidationException- when the aggregation is blank
-
-
Method Details
-
of
Atotalcompute.- Parameters:
aggregation- aggregation function- Returns:
- the compute
-
timeseries
Returns a copy as a timeseries with the given bucket interval.- Parameters:
interval- bucket interval, e.g.5m- Returns:
- the compute
-
withMetric
Returns a copy with a measure.- Parameters:
metric- measure, e.g.@duration- Returns:
- the compute
-
toWire
Returns the wire form.- Returns:
- a new map
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
aggregation
Returns the value of theaggregationrecord component.- Returns:
- the value of the
aggregationrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
interval
Returns the value of theintervalrecord component.- Returns:
- the value of the
intervalrecord component
-
metric
Returns the value of themetricrecord component.- Returns:
- the value of the
metricrecord component
-