public class MetricsSnapshot extends Object implements MetricsSnapshotInterface
Constructor and 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 subject
|
MetricsSnapshot(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
|
Modifier and Type | Method and 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() |
public MetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, String subject, String logChannelId)
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
- public MetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, String logChannelId)
type
- description
- logChannelId
- public MetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, String subject, long value, String logChannelId)
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.public MetricsSnapshot(MetricsSnapshotType type, MetricsInterface metric, long value, String logChannelId)
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.public String getKey()
MetricsSnapshotInterface
getKey
in interface MetricsSnapshotInterface
public static String getKey(MetricsInterface metric, String subject)
public Date getDate()
getDate
in interface MetricsSnapshotInterface
public void setDate(Date date)
setDate
in interface MetricsSnapshotInterface
date
- the date to setpublic MetricsSnapshotType getType()
public void setType(MetricsSnapshotType type)
type
- the type to setpublic String getSubject()
getSubject
in interface MetricsSnapshotInterface
public void setSubject(String subject)
subject
- the subject to setpublic Long getValue()
getValue
in interface MetricsSnapshotInterface
public void setValue(Long value)
setValue
in interface MetricsSnapshotInterface
value
- the value to setpublic String getLogChannelId()
getLogChannelId
in interface MetricsSnapshotInterface
public void setLogChannelId(String logChannelId)
logChannelId
- the logChannelId to setpublic MetricsInterface getMetric()
getMetric
in interface MetricsSnapshotInterface
public void setMetric(MetricsInterface metric)
metric
- the metric to set