spark.timeseries

EnergyOps

object EnergyOps extends AnyRef

A class that shows some energy data processing facilities, such as calculation of total energy consumed during an energy measurement experiment, detection of interesting peaks or periods of activity from energy data, and saving statistics of these runs into a file.

Usage:


 val master = "local[1]"
 val fileName = "csv.csv"
 val idleThresh = 200

 val sc = TimeSeriesSpark.init(master, "default")
    val reduced = detectRuns(sc, fileName, idleThresh).cache()

    val str = reduced.map(k => { k._1 + ", " + k._2 + ", " + k._3 + " s, " + k._4 + " Wh" })
    str.saveAsTextFile("temp")
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. EnergyOps
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def ArrayRunMapper (run: Run[Double]): (Double, Double, Double, Double)

  7. def RunMapper (x: Array[(Double, Double, Double)]): (Double, Double, Double, Double)

  8. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  9. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. def detectRuns (sc: SparkContext, fileName: String, idleThresh: String): RDD[(Double, Double, Double, Double)]

    Map energy measurements into scala.Arrays of scala.Doubles, and separate the data into measurement Runs based on the idleThresh threshold.

    Map energy measurements into scala.Arrays of scala.Doubles, and separate the data into measurement Runs based on the idleThresh threshold. An average over half a second is calculated from each half a second period of the data. If such an average is above idleThresh, values in the period and after it are considered a measurement run. When the average drops below idleThresh, the run is considered finished. Periods of averages of less than idleThresh are skipped.

    sc

    the SparkContext used to execute the task.

    fileName

    data file path. Assumed to contain a text file with lines of the form

    num, secs, mA, V
    

    where num is an integer measurement number, secs is the time in seconds since measurement was started, mA the current in milliAmperes, and V is the voltage in Volts. Example:

    1, 0.000, 350, 3.95
    2, 0.002, 342, 3.96
    ...
    
    idleThresh

    The threshold to compare half a second averages against, and detect activity.

  11. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  12. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  15. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  16. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  17. def main (args: Array[String]): Unit

    Main program entry point.

    Main program entry point. runs detectRuns and saves the result as a file called "temp" in the current directory.

  18. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  19. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  20. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  21. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  22. def toString (): String

    Definition Classes
    AnyRef → Any
  23. def totalEnergy (sc: SparkContext, mapped: RDD[(Double, Double, Double)]): Unit

    Calculate total energy of an entire measurement file using the deprecated tuple-based MeasurementRunRDD class.

  24. def tupleTest (sc: SparkContext, fileName: String, idleThresh: String): RDD[(Double, Double, Double, Double)]

  25. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  26. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  27. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any