org.rhq.enterprise.server.measurement
Interface MeasurementBaselineManagerLocal

All Known Implementing Classes:
MeasurementBaselineManagerBean

public interface MeasurementBaselineManagerLocal

A manager for MeasurementBaselines.

Author:
Heiko W. Rupp, John Mazzitelli, Joseph Marques

Method Summary
 int _calculateAutoBaselinesDELETE(long olderThanTime)
          Deletes baselines that are older than the time specified
 int _calculateAutoBaselinesINSERT(long amountOfData)
          Inserts baselines "as appropriate" for measurements that have at least amountOfData
 org.rhq.core.domain.measurement.MeasurementBaseline calculateAutoBaseline(org.rhq.core.domain.auth.Subject subject, Integer measurementScheduleId, long startDate, long endDate, boolean save)
          Calculate a baseline value for the given metric based on the specified date range, optionally setting the metric's baseline to the calculated value.
 org.rhq.core.domain.measurement.MeasurementBaseline calculateAutoBaseline(org.rhq.core.domain.auth.Subject subject, int groupId, int definitionId, long startDate, long endDate, boolean save)
           
 org.rhq.core.domain.measurement.MeasurementBaseline calculateAutoBaselineForGroupInNewTransaction(org.rhq.core.domain.auth.Subject subject, int groupId, int definitionId, long startDate, long endDate, boolean save)
           
 org.rhq.core.domain.measurement.MeasurementBaseline calculateAutoBaselineInNewTransaction(org.rhq.core.domain.auth.Subject subject, Integer measurementScheduleId, long startDate, long endDate, boolean save)
           
 void calculateAutoBaselines()
          This is the entry point which calls out to all other *calculateAutoBaselines* methods seen in this interface.
 long calculateAutoBaselines(long amountOfData, long olderThanTime)
          Calculates baselines for all scheduled measurements.
 void enableAutoBaselineCalculation(org.rhq.core.domain.auth.Subject subject, Integer[] resourceIds, Integer[] definitionIds)
          Unset the user-entered property in baselines so that we can do autobaselines on it again.
 List<org.rhq.core.domain.measurement.MeasurementBaseline> findBaselinesForResource(org.rhq.core.domain.auth.Subject subject, int resourceId)
          Return a list of MeasurementBaseline objects for the Resource represented by the given id.
 org.rhq.core.domain.measurement.MeasurementBaseline getBaselineIfEqual(org.rhq.core.domain.auth.Subject subject, int groupId, int definitionId)
           
 

Method Detail

calculateAutoBaselines

void calculateAutoBaselines()
This is the entry point which calls out to all other *calculateAutoBaselines* methods seen in this interface. This is the method that should be called on a regular basis by some sort of job scheduler / timer to determine whether baselines even need to be calculated. This is an inexpensive operation and can be run every minute if needed because it will only calculate baselines for the ones that need it (as configured by the system preferences for how frequently they should be recalculated, and how much data should be used in that recalculation).


calculateAutoBaselines

long calculateAutoBaselines(long amountOfData,
                            long olderThanTime)
Calculates baselines for all scheduled measurements. The measurement data that was collected between the given start and end times is used to calculate the baselines.

Parameters:
amountOfData - will use amountOfData to compute new min/max/mean for baselines as appropriate
olderThanTime - deletes baselines older than the time specified
Returns:
the time that all the baselines were computed;

_calculateAutoBaselinesDELETE

int _calculateAutoBaselinesDELETE(long olderThanTime)
                                  throws Exception
Deletes baselines that are older than the time specified

Parameters:
olderThanTime - deletes baselines older than the time specified
Returns:
number of rows deleted
Throws:
Exception

_calculateAutoBaselinesINSERT

int _calculateAutoBaselinesINSERT(long amountOfData)
                                  throws Exception
Inserts baselines "as appropriate" for measurements that have at least amountOfData

Parameters:
amountOfData - will use amountOfData to compute new min/max/mean for baselines as appropriate
Returns:
number of rows inserted
Throws:
Exception

getBaselineIfEqual

org.rhq.core.domain.measurement.MeasurementBaseline getBaselineIfEqual(org.rhq.core.domain.auth.Subject subject,
                                                                       int groupId,
                                                                       int definitionId)

calculateAutoBaseline

org.rhq.core.domain.measurement.MeasurementBaseline calculateAutoBaseline(org.rhq.core.domain.auth.Subject subject,
                                                                          Integer measurementScheduleId,
                                                                          long startDate,
                                                                          long endDate,
                                                                          boolean save)
                                                                          throws BaselineCreationException,
                                                                                 MeasurementNotFoundException
Calculate a baseline value for the given metric based on the specified date range, optionally setting the metric's baseline to the calculated value.

Parameters:
subject -
measurementScheduleId - measurement id to recalc.
startDate - begin date range
endDate - end date range
save - whether or not to save the recalculated baseline
Returns:
the calculated baseline value
Throws:
BaselineCreationException
MeasurementNotFoundException

calculateAutoBaselineInNewTransaction

org.rhq.core.domain.measurement.MeasurementBaseline calculateAutoBaselineInNewTransaction(org.rhq.core.domain.auth.Subject subject,
                                                                                          Integer measurementScheduleId,
                                                                                          long startDate,
                                                                                          long endDate,
                                                                                          boolean save)
                                                                                          throws BaselineCreationException,
                                                                                                 MeasurementNotFoundException
Throws:
BaselineCreationException
MeasurementNotFoundException

calculateAutoBaseline

org.rhq.core.domain.measurement.MeasurementBaseline calculateAutoBaseline(org.rhq.core.domain.auth.Subject subject,
                                                                          int groupId,
                                                                          int definitionId,
                                                                          long startDate,
                                                                          long endDate,
                                                                          boolean save)
                                                                          throws BaselineCreationException,
                                                                                 MeasurementNotFoundException
Throws:
BaselineCreationException
MeasurementNotFoundException

calculateAutoBaselineForGroupInNewTransaction

org.rhq.core.domain.measurement.MeasurementBaseline calculateAutoBaselineForGroupInNewTransaction(org.rhq.core.domain.auth.Subject subject,
                                                                                                  int groupId,
                                                                                                  int definitionId,
                                                                                                  long startDate,
                                                                                                  long endDate,
                                                                                                  boolean save)
                                                                                                  throws BaselineCreationException,
                                                                                                         MeasurementNotFoundException
Throws:
BaselineCreationException
MeasurementNotFoundException

enableAutoBaselineCalculation

void enableAutoBaselineCalculation(org.rhq.core.domain.auth.Subject subject,
                                   Integer[] resourceIds,
                                   Integer[] definitionIds)
Unset the user-entered property in baselines so that we can do autobaselines on it again.

Parameters:
subject -
resourceIds -
definitionIds - measurement definition IDs

findBaselinesForResource

List<org.rhq.core.domain.measurement.MeasurementBaseline> findBaselinesForResource(org.rhq.core.domain.auth.Subject subject,
                                                                                   int resourceId)
Return a list of MeasurementBaseline objects for the Resource represented by the given id.

Parameters:
subject - the user request to view the baseline history for the given resource
resourceId - the id of the resource whose baselines are to be returned
Returns:
a list of baselines for all measurements scheduled on the given resource


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.