Package org.aksw.iguana.rp.metrics
Interface Metric
-
- All Known Implementing Classes:
AbstractMetric
,AvgQPSMetric
,EachQueryMetric
,F1MeasureMetric
,NoQMetric
,NoQPHMetric
,QMPHMetric
,QPSMetric
public interface Metric
This is the Interface for all Metrics- Author:
- f.conrads
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
This method will be called, as soon as the associated Experiment Task is finished.java.lang.String
getDescription()
This method should return a short description of what the Metric will calculate For example (No.java.lang.String
getName()
This method should return the Metric Name For example: "Query Mixes Per Hour"java.lang.String
getShortName()
This method should return an abbreviated version of the Metric name.StorageManager
getStorageManager()
void
receiveData(java.util.Properties p)
This method should implement what to do with one result.void
setMetaData(java.util.Properties metaData)
This method will be called by theExperimentManager
to provide meta data such as the number of query mixes.void
setStorageManager(StorageManager sManager)
-
-
-
Method Detail
-
receiveData
void receiveData(java.util.Properties p)
This method should implement what to do with one result. For example: No Of Queries Per Hour will get the time query time add the time to a variable which keeps track of the total time of all executed queries and increase the number of executed queries if the query was successfully executed. Be aware, that in this example, the Metric could be stopped as soon as one hour is reached, or it could be calculate in the close method. Assuming, the totaltime is in minutes (it should be calculated in ms though) Latter one will result in the following formular: m = 60 * queries / totaltime The actual keys of the properties will depend on the core. The stress test will send different keys than a completeness test. Thus not all metrics are available for each test. Hence it should be implemented if the Metric cannot calculate the test results that it will just close itself without adding results.- Parameters:
p
-
-
setStorageManager
void setStorageManager(StorageManager sManager)
-
getStorageManager
StorageManager getStorageManager()
-
close
void close()
This method will be called, as soon as the associated Experiment Task is finished. Not all metrics are available for each test. Hence it should be implemented if the Metric cannot calculate the test results that it will just close itself without adding results. TheMetricManager
will try to close the Metric still, thus it should be checked if that was the case.
-
getDescription
java.lang.String getDescription()
This method should return a short description of what the Metric will calculate For example (No. of Queries Per Hour): "Will sum up all successful executed Queries in one hour."- Returns:
-
getName
java.lang.String getName()
This method should return the Metric Name For example: "Query Mixes Per Hour"- Returns:
-
getShortName
java.lang.String getShortName()
This method should return an abbreviated version of the Metric name. For example (Query Mixes Per Hour): "QMPH"- Returns:
-
setMetaData
void setMetaData(java.util.Properties metaData)
This method will be called by theExperimentManager
to provide meta data such as the number of query mixes.- Parameters:
metaData
-
-
-