Package org.pentaho.di.core.metrics
Class MetricsSnapshot
- java.lang.Object
-
- org.pentaho.di.core.metrics.MetricsSnapshot
-
- All Implemented Interfaces:
MetricsSnapshotInterface
public class MetricsSnapshot extends Object implements MetricsSnapshotInterface
-
-
Constructor Summary
Constructors Constructor Description MetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, long value, String logChannelId)Create a snapshot metric with a value.MetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, String logChannelId)Create a new metrics snapshot without a subjectMetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, String subject, long value, String logChannelId)Create a snapshot metric with a value.MetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, String subject, String logChannelId)Create a new metrics snapshot
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DategetDate()StringgetKey()Calculate the key for this snapshot, usually a combination of description and subject.static StringgetKey(MetricsInterface metric, String subject)StringgetLogChannelId()MetricsInterfacegetMetric()StringgetSubject()MetricsSnapshotTypegetType()LonggetValue()voidsetDate(Date date)voidsetLogChannelId(String logChannelId)voidsetMetric(MetricsInterface metric)voidsetSubject(String subject)voidsetType(MetricsSnapshotType type)voidsetValue(Long value)StringtoString()
-
-
-
Constructor Detail
-
MetricsSnapshot
public MetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, String subject, String logChannelId)
Create a new metrics snapshot- Parameters:
type-metric- the metric to use (ex. Connect to database)subject- the name of the metric subject (ex. the name of the database we're connecting to)logChannelId-
-
MetricsSnapshot
public MetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, String logChannelId)
Create a new metrics snapshot without a subject- Parameters:
type-description-logChannelId-
-
MetricsSnapshot
public MetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, String subject, long value, String logChannelId)
Create a snapshot metric with a value.- Parameters:
type- The type. For metrics with a value it is usually MIN, MAX, SUM, COUNT, ...metric- The metric to usesubject- The subjectvalue- The valuelogChannelId- The logging channel to reference.
-
MetricsSnapshot
public MetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, long value, String logChannelId)
Create a snapshot metric with a value.- Parameters:
type- The type. For metrics with a value it is usually MIN, MAX, SUM, COUNT, ...description- The descriptionvalue- The valuelogChannelId- The logging channel to reference.
-
-
Method Detail
-
getKey
public String getKey()
Description copied from interface:MetricsSnapshotInterfaceCalculate the key for this snapshot, usually a combination of description and subject.- Specified by:
getKeyin interfaceMetricsSnapshotInterface- Returns:
- the key for this snapshot
-
getKey
public static String getKey(MetricsInterface metric, String subject)
-
getDate
public Date getDate()
- Specified by:
getDatein interfaceMetricsSnapshotInterface- Returns:
- the date
-
setDate
public void setDate(Date date)
- Specified by:
setDatein interfaceMetricsSnapshotInterface- Parameters:
date- the date to set
-
getType
public MetricsSnapshotType getType()
- Returns:
- the type
-
setType
public void setType(MetricsSnapshotType type)
- Parameters:
type- the type to set
-
getSubject
public String getSubject()
- Specified by:
getSubjectin interfaceMetricsSnapshotInterface- Returns:
- the subject
-
setSubject
public void setSubject(String subject)
- Parameters:
subject- the subject to set
-
getValue
public Long getValue()
- Specified by:
getValuein interfaceMetricsSnapshotInterface- Returns:
- the value
-
setValue
public void setValue(Long value)
- Specified by:
setValuein interfaceMetricsSnapshotInterface- Parameters:
value- the value to set
-
getLogChannelId
public String getLogChannelId()
- Specified by:
getLogChannelIdin interfaceMetricsSnapshotInterface- Returns:
- the logChannelId
-
setLogChannelId
public void setLogChannelId(String logChannelId)
- Parameters:
logChannelId- the logChannelId to set
-
getMetric
public MetricsInterface getMetric()
- Specified by:
getMetricin interfaceMetricsSnapshotInterface- Returns:
- the metric
-
setMetric
public void setMetric(MetricsInterface metric)
- Parameters:
metric- the metric to set
-
-