|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface UsageReportFacade
| Method Summary | |
|---|---|
void |
addUsageReport(UsageReport report)
Process a usage report. |
void |
addUsageReports(List<UsageReport> reports)
Process batch of usage reports. |
List<Metric> |
getMetricsForResource(Long resourceEntityId)
Get a list of all Metrics used by the ResourceWithUsageByMetric
identified by resourceEntityId. |
double |
getRate(Long resourceEntityId,
Metric metric,
long instant)
Calculate the rate at an instant in time for the ResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and at the given instant. |
double |
getTotalPositiveRateChange(Long resourceEntityId,
Metric metric,
long startInstant,
long endInstant)
Aggregate all positive rate changes between startInstant and endInstant
for the ResourceWithUsageByMetric entity identified by resourceEntityId
and for a particular metric. |
double |
getUsage(Long resourceEntityId,
Metric metric,
long instant)
Calculate the usage at an instant in time for the ResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and at the given instant. |
List<UsageSummaryElement> |
getUsageElements(Long resourceEntityId,
Metric metric,
long start,
long end)
Get a list of UsageSummaryElements that represent a summary of usage for
a metric on a particular resource. |
double |
getUsageInPeriod(Long resourceEntityId,
Metric metric,
long startInstant,
long endInstant)
Calculate the usage that accumulated for the ResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and between the time period bounded by startInstant and
endInstant. |
| Method Detail |
|---|
void addUsageReport(UsageReport report)
report - the report to porcessvoid addUsageReports(List<UsageReport> reports)
reports - the list of usage reports to process
double getRate(Long resourceEntityId,
Metric metric,
long instant)
ResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and at the given instant.
resourceEntityId - the entity id of the ResourceWithUsageByMetricmetric - the Metric of interestinstant - the time instant in milliseconds
double getTotalPositiveRateChange(Long resourceEntityId,
Metric metric,
long startInstant,
long endInstant)
startInstant and endInstant
for the ResourceWithUsageByMetric entity identified by resourceEntityId
and for a particular metric.
Note that only positive rate changes are included in the result. Also, a rate change at
startInstant is excluded whereas a rate change at endInstant is
included.
resourceEntityId - the entity id of the ResourceWithUsageByMetricmetric - the Metric of intereststartInstant - the time instant in milliseconds at the start of the periodendInstant - the time instant in milliseconds at the end of the period
double getUsage(Long resourceEntityId,
Metric metric,
long instant)
ResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and at the given instant.
resourceEntityId - the entity id of the ResourceWithUsageByMetricmetric - the Metric of interestinstant - the time instant in milliseconds
double getUsageInPeriod(Long resourceEntityId,
Metric metric,
long startInstant,
long endInstant)
ResourceWithUsageByMetric
entity identified by resourceEntityId for a particular Metric
and between the time period bounded by startInstant and
endInstant.
resourceEntityId - the entity id of the ResourceWithUsageByMetricmetric - the Metric of intereststartInstant - the time instant in milliseconds at the start of the periodendInstant - the time instant in milliseconds at the end of the period
List<UsageSummaryElement> getUsageElements(Long resourceEntityId,
Metric metric,
long start,
long end)
UsageSummaryElements that represent a summary of usage for
a metric on a particular resource. start and end
are both optional and can be used to constrain by time, the range of elements returned.
Note that each UsageSummaryElement returned will have absolute rate and
usage set correctly. This may be different from the representation in the database.
resourceEntityId - the entity id of the ResourceWithUsageByMetricmetric - the Metric of intereststart - the time at which to start the summary or -1 if the summary should
start from the beginningend - the time at which to end the summary or -1 if all elements from start
onwards should be retrieved.
List<Metric> getMetricsForResource(Long resourceEntityId)
Metrics used by the ResourceWithUsageByMetric
identified by resourceEntityId.
resourceEntityId - the resource id for the owning ResourceWithUsageByMetric
List of Metrics associated with the resource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||