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 Date
getDate()
String
getKey()
Calculate the key for this snapshot, usually a combination of description and subject.static String
getKey(MetricsInterface metric, String subject)
String
getLogChannelId()
MetricsInterface
getMetric()
String
getSubject()
MetricsSnapshotType
getType()
Long
getValue()
void
setDate(Date date)
void
setLogChannelId(String logChannelId)
void
setMetric(MetricsInterface metric)
void
setSubject(String subject)
void
setType(MetricsSnapshotType type)
void
setValue(Long value)
String
toString()
-
-
-
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:MetricsSnapshotInterface
Calculate the key for this snapshot, usually a combination of description and subject.- Specified by:
getKey
in interfaceMetricsSnapshotInterface
- Returns:
- the key for this snapshot
-
getKey
public static String getKey(MetricsInterface metric, String subject)
-
getDate
public Date getDate()
- Specified by:
getDate
in interfaceMetricsSnapshotInterface
- Returns:
- the date
-
setDate
public void setDate(Date date)
- Specified by:
setDate
in 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:
getSubject
in interfaceMetricsSnapshotInterface
- Returns:
- the subject
-
setSubject
public void setSubject(String subject)
- Parameters:
subject
- the subject to set
-
getValue
public Long getValue()
- Specified by:
getValue
in interfaceMetricsSnapshotInterface
- Returns:
- the value
-
setValue
public void setValue(Long value)
- Specified by:
setValue
in interfaceMetricsSnapshotInterface
- Parameters:
value
- the value to set
-
getLogChannelId
public String getLogChannelId()
- Specified by:
getLogChannelId
in interfaceMetricsSnapshotInterface
- Returns:
- the logChannelId
-
setLogChannelId
public void setLogChannelId(String logChannelId)
- Parameters:
logChannelId
- the logChannelId to set
-
getMetric
public MetricsInterface getMetric()
- Specified by:
getMetric
in interfaceMetricsSnapshotInterface
- Returns:
- the metric
-
setMetric
public void setMetric(MetricsInterface metric)
- Parameters:
metric
- the metric to set
-
-