Class AbstractMetric

  • All Implemented Interfaces:
    Metric
    Direct Known Subclasses:
    EachQueryMetric, F1MeasureMetric, NoQMetric, NoQPHMetric, QPSMetric

    public abstract class AbstractMetric
    extends java.lang.Object
    implements Metric
    Abstract Metric class which implements the method sendData so the final Metric class can send their final data via this command to the storages
    Author:
    f.conrads
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractMetric()
      This constructor will not set name, Short name and description Thus the final Metric class has to set them itself.
      AbstractMetric​(java.lang.String name, java.lang.String shortName, java.lang.String description)
      Will create an Metric class with the name, short name and description
    • Method Summary

      All Methods Instance Methods Concrete 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.
      org.apache.jena.rdf.model.Property getMetricProperty()  
      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()  
      org.apache.jena.rdf.model.Resource getSubject​(java.util.Properties recv)  
      org.apache.jena.rdf.model.Resource getTaskResource()  
      void sendData​(org.apache.jena.rdf.model.Model m)  
      void setMetaData​(java.util.Properties metaData)
      Will add the Meta Data to the Metric
      void setStorageManager​(StorageManager smanager)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractMetric

        public AbstractMetric()
        This constructor will not set name, Short name and description Thus the final Metric class has to set them itself.
      • AbstractMetric

        public AbstractMetric​(java.lang.String name,
                              java.lang.String shortName,
                              java.lang.String description)
        Will create an Metric class with the name, short name and description
        Parameters:
        name -
        shortName -
        description -
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: Metric
        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."
        Specified by:
        getDescription in interface Metric
        Returns:
      • getName

        public java.lang.String getName()
        Description copied from interface: Metric
        This method should return the Metric Name For example: "Query Mixes Per Hour"
        Specified by:
        getName in interface Metric
        Returns:
      • getShortName

        public java.lang.String getShortName()
        Description copied from interface: Metric
        This method should return an abbreviated version of the Metric name. For example (Query Mixes Per Hour): "QMPH"
        Specified by:
        getShortName in interface Metric
        Returns:
      • setMetaData

        public void setMetaData​(java.util.Properties metaData)
        Will add the Meta Data to the Metric
        Specified by:
        setMetaData in interface Metric
      • getTaskResource

        public org.apache.jena.rdf.model.Resource getTaskResource()
      • getSubject

        public org.apache.jena.rdf.model.Resource getSubject​(java.util.Properties recv)
      • getMetricProperty

        public org.apache.jena.rdf.model.Property getMetricProperty()
      • sendData

        public void sendData​(org.apache.jena.rdf.model.Model m)
      • close

        public void close()
        Description copied from interface: Metric
        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. The MetricManager will try to close the Metric still, thus it should be checked if that was the case.
        Specified by:
        close in interface Metric