Package io.vertigo.core.analytics.metric
Record Class Metric
java.lang.Object
java.lang.Record
io.vertigo.core.analytics.metric.Metric
public record Metric(Instant measureInstant, String name, String module, String feature, Double value, Metric.Status status)
extends Record
A Metric represents a measurement or observation at a specific point in time.
- Author:
- mlaroche, pchretien
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe status of a metric can be either SUCCESS or ERROR. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MetricBuilderbuilder()Static method factory for creating a MetricBuilder.final booleanIndicates whether some other object is "equal to" this one.feature()Returns the value of thefeaturerecord component.final inthashCode()Returns a hash code value for this object.Returns the value of themeasureInstantrecord component.module()Returns the value of themodulerecord component.name()Returns the value of thenamerecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Metric
public Metric(Instant measureInstant, String name, String module, String feature, Double value, Metric.Status status) Constructor for Metric.- Parameters:
measureInstant- The instant at which the metric was measured.name- The name of the metric.module- The module associated with the metric. May be null.feature- The feature associated with the metric.value- The value of the metric. May be null.status- The status of the metric.
-
-
Method Details
-
builder
Static method factory for creating a MetricBuilder.- Returns:
- A new MetricBuilder instance.
-
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). -
measureInstant
Returns the value of themeasureInstantrecord component.- Returns:
- the value of the
measureInstantrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
module
Returns the value of themodulerecord component.- Returns:
- the value of the
modulerecord component
-
feature
Returns the value of thefeaturerecord component.- Returns:
- the value of the
featurerecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-