Skip to content

Export Citation

        
          
@article{fieni-2024,
TITLE = {{PowerAPI: A Python framework for building software-defined power meters}},
AUTHOR = {Fieni, Guillaume and Acero, Daniel Romero and Rust, Pierre and Rouvoy, Romain},
URL = {https://hal.science/hal-04601379},
JOURNAL = {{Journal of Open Source Software}},
PUBLISHER = {{Open Journals}},
VOLUME = {9},
NUMBER = {98},
PAGES = {6670},
YEAR = {2024},
MONTH = Jun,
DOI = {10.21105/joss.06670},
KEYWORDS = {Power ; Energy ; Toolkit ; Measurement ; Framework},
PDF = {https://hal.science/hal-04601379/file/10.21105.joss.06670-3.pdf},
HAL_ID = {hal-04601379},
HAL_VERSION = {v1},
}
          
          
              
      

Formula Configuration

PowerAPI can read configurations through the CLI or through configuration files.

CLI Parameters

The table below shows basic parameters.

Parameter Type CLI shortcut Default Value Description
verbose bool (flag) v NOTSET Verbose or quiet mode
stream bool (flag) s False Real time or post-mortem mode
sensor-report-sampling-interval int N/A 1000 The time in milliseconds between two reports (stream = True)
input string (Source) N/A N/A Source used as input. More information about Sources and their related parameters can be found here
output string (Destination) N/A N/A Destination used as output. More information about Destinations and their related parameters can be found here
pre-processor string N/A N/A Pre-Processor to modify reports generated by a sensor. More information about Processors and their related parameters can be found here
post-processor string N/A N/A Post-Processor to modify reports generated by a formula. More information about Processors and their related parameters can be found here
Sources and Destinations' values
  • Sources: mongodb, csv, socket, filedb
  • Destinations: mongodb, influxedb, influxedb2, csv, socket, filedb, prom
Processors' values
  • Pre-Processors: k8s, libvirt

Configuration File

PowerAPI Formulas use json files. These files follow the next template:

{
  "verbose": $bool,
  "stream": $bool ,
  "sensor-report-sampling-interval" : $int,
  "input": {
    $puller_name: {
      "model": $type_of_report,
      "type": $type_of_database,
      $database_parameters
    }
    ... #(Multiple pullers can be used)
  },
  "output": {
    $pusher_name: {
      "type": $type_of_database
      $database_parameters
    }
    ... #(Multiple pushers can be used)

  },
  $processors_if_required
  $formula_parameters
}
Sources and Destinations' json tags

More information related to json tags for each Source/Destination can be found here