Class MetricUtils


  • public final class MetricUtils
    extends Object
    Utility class for metrics. TODO #372: This class should later be refactored into a separate metric package.
    • Field Detail

      • SQLITE_DB_NAME

        public static final String SQLITE_DB_NAME
    • Method Detail

      • loadMetaData

        public static Boolean loadMetaData()
        Load the BiMaps (lightweight) Metadata from the DB.
        Returns:
        Whether or not the metadata has been successfully loaded from the DB.
      • metaDataLoaded

        public static Boolean metaDataLoaded()
      • stringifyIRDAGProperties

        public static Pair<String,​String> stringifyIRDAGProperties​(IRDAG irdag)
        Stringify execution properties of an IR DAG.
        Parameters:
        irdag - IR DAG to observe.
        Returns:
        the pair of stringified execution properties. Left is for vertices, right is for edges.
      • getMethodFor

        public static Optional<Method> getMethodFor​(Class<? extends ExecutionProperty> clazz,
                                                    String name,
                                                    Class<?>... valueTypes)
        Utility method to getting an optional method called 'name' for the class.
        Parameters:
        clazz - class to get the method of.
        name - the name of the method.
        valueTypes - the value types of the method.
        Returns:
        optional of the method. It returns Optional.empty() if the method could not be found.
      • keyAndValueToEP

        public static ExecutionProperty<? extends Serializable> keyAndValueToEP​(Integer epKeyIndex,
                                                                                Double split,
                                                                                Double tweak)
        Receives the pair of execution property and value classes, and returns the optimized value of the EP.
        Parameters:
        epKeyIndex - the EP Key index to retrieve the new EP from.
        split - the split point.
        tweak - the direction in which to tweak the execution property value.
        Returns:
        The execution property constructed from the key index and the split value.