Package org.palladiosimulator.edp2.util
Class MeasurementsUtility
- java.lang.Object
-
- org.palladiosimulator.edp2.util.MeasurementsUtility
-
public class MeasurementsUtility extends Object
This class provides utility functions to handle measurements.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SLIDING_WINDOW_BASED_MEASUREMENT_TAG_KEY
static Boolean
SLIDING_WINDOW_BASED_MEASUREMENT_TAG_VALUE
-
Constructor Summary
Constructors Constructor Description MeasurementsUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MeasurementRange
addMeasurementRange(Measurement measurement)
Creates a new MeasurementRange and contained elements if there are already existing elements in another MeasurementRange.static void
createDAOsForRawMeasurements(RawMeasurements rm)
Creates the DAOs for the data series of a raw measurement.static void
ensureClosedRepository(Repository repo)
Closes the data store behind the repository if necessary.static void
ensureOpenRepository(Repository repo)
Opens the data store behind the repository if necessary.static <Q extends javax.measure.quantity.Quantity>
MeasurementsDao<?,Q>getMeasurementsDao(DataSeries ds)
Requests a DAO for a ordinal measurement.static MeasuringType
getMeasuringTypeFromRawMeasurements(RawMeasurements rawMeasurements)
static org.palladiosimulator.metricspec.MetricDescription
getMetricDescriptionFromRawMeasurements(RawMeasurements rawMeasurements)
static org.palladiosimulator.metricspec.TextualBaseMetricDescription
getTextualBaseMetricDescriptionFromIdentifierMeasurement(IdentifierBasedMeasurements idBasedMeasurement)
static void
storeMeasurement(Measurement measurement, org.palladiosimulator.measurementframework.MeasuringValue measuringValue)
Stores a new measurement at the last existing range.
-
-
-
Field Detail
-
SLIDING_WINDOW_BASED_MEASUREMENT_TAG_KEY
public static final String SLIDING_WINDOW_BASED_MEASUREMENT_TAG_KEY
- See Also:
- Constant Field Values
-
SLIDING_WINDOW_BASED_MEASUREMENT_TAG_VALUE
public static final Boolean SLIDING_WINDOW_BASED_MEASUREMENT_TAG_VALUE
-
-
Method Detail
-
addMeasurementRange
public static MeasurementRange addMeasurementRange(Measurement measurement)
Creates a new MeasurementRange and contained elements if there are already existing elements in another MeasurementRange. Does not set the startTime and endTime properties.- Parameters:
measurement
- Location where to add the range.- Returns:
- The newly created measurement range.
-
createDAOsForRawMeasurements
public static void createDAOsForRawMeasurements(RawMeasurements rm)
Creates the DAOs for the data series of a raw measurement.- Parameters:
rm
- The raw measurements containing the data series.
-
storeMeasurement
public static void storeMeasurement(Measurement measurement, org.palladiosimulator.measurementframework.MeasuringValue measuringValue)
Stores a new measurement at the last existing range.- Parameters:
measuringValue
- The measurement of the experiment run for which a new measurement exists.data
- The measurement (data) itself.
-
getMeasurementsDao
public static <Q extends javax.measure.quantity.Quantity> MeasurementsDao<?,Q> getMeasurementsDao(DataSeries ds)
Requests a DAO for a ordinal measurement. If the DAO does not exists it is created and opened automatically (if possible).- Parameters:
ds
- The data series for which the DAO should be created.- Returns:
- DAO for ordinal measurements.
-
getMeasuringTypeFromRawMeasurements
public static MeasuringType getMeasuringTypeFromRawMeasurements(RawMeasurements rawMeasurements)
-
getMetricDescriptionFromRawMeasurements
public static org.palladiosimulator.metricspec.MetricDescription getMetricDescriptionFromRawMeasurements(RawMeasurements rawMeasurements)
-
getTextualBaseMetricDescriptionFromIdentifierMeasurement
public static org.palladiosimulator.metricspec.TextualBaseMetricDescription getTextualBaseMetricDescriptionFromIdentifierMeasurement(IdentifierBasedMeasurements idBasedMeasurement)
-
ensureOpenRepository
public static void ensureOpenRepository(Repository repo) throws DataNotAccessibleException
Opens the data store behind the repository if necessary. Access is only allowed to opened repositories. Repositories may be reopened (and the also reclosed).- Parameters:
repo
- Repository which should be opened.- Throws:
DataNotAccessibleException
- if access to the repository fails.
-
ensureClosedRepository
public static void ensureClosedRepository(Repository repo) throws DataNotAccessibleException
Closes the data store behind the repository if necessary. Access is only allowed to opened repositories. Repositories may be reopened (and the also reclosed).- Parameters:
repo
- Repository which should be closed.- Throws:
DataNotAccessibleException
- if access to the repository fails.
-
-