Skip to content

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 N/A N/A SmartWatts input, shall match an existing Sensor output and contain HPWCReports. See here
output string N/A N/A SmartWatts output to store Power Report. See 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
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
}