Giter Site home page Giter Site logo

power's Introduction

Power API

What is it

Power API is an open source project maintained by Spirals research group. It offers software-defined power meters which can measure the power consumption of a program.

Power API

Power API is kind of an umbrella of multiple tools, targeting measurement of energy consumption from different sources. Regardless of which one you use, ensure that the host you are trying to measure is based on Intel's Sandy Bridge+ processor architecture.

Under the hood Power API is relaying on Inte's Running Average Power Limit(RAPL) to get power meter

Architecture

There are a couple of actors involved in the process.

  • Sensor - collects actual power consumptions from the host
  • Formulas - converts raw data from sensor into human readable format
  • Databases - store sensor and formula data

RAPL formula

The RAPL formula is designed to measure power consumption of domains (cpu or ram) in real time. For more info see https://powerapi-ng.github.io/rapl.html#rapl

Smartwatts

SmartWatts is a software-defined power meter that can estimate the power consumption of software in real-time. For more info see https://powerapi-ng.github.io/smartwatts.html#smartwatts

Jouleit

Jouleit can measure power consumption of the CPU, ram and integrated GPU. For more info see https://powerapi-ng.github.io/jouleit.html#jouleit

VirtualWatts

VirtualWatts can measure the power consumption of software inside a Virtual Machine (VM) in real-time. For more info see https://powerapi-ng.github.io/virtualwatts.html#virtualwatts

How to run it

  1. Start mongodb database where we will store sensor data

    docker run -d  --name metrics-db  -p 27888:27017 \
    -e MONGO_INITDB_ROOT_USERNAME=mongoadmin \
    -e MONGO_INITDB_ROOT_PASSWORD=supersecret mongo
  2. Start InfluxDB database for storing formula data

    $ docker run -d --name influx_rapl -p 8086:8086 influxdb:1.8
  3. Start the sensor. We will be running the sensor as docker container but there are some other ways also to run it. The sensor script takes config_file_sensor.json as configuration file.

     $ git clone https://github.com/fmuyassarov/power.git
     $ cd power
     $ ./sensor.sh
  4. Start the formula. As an example, we will be using formula_smartwats.sh script to start off smartwatts formula. The sensor script takes config_file_smartwats.json as configuration file. Make sure that you have updated "uri": "mongodb://172.17.0.2" with the correct URI to your mongodb instance.

     $ ./formula_smartwats.sh
  5. At this point, there will be two databases, sensor and formula running. The last step is to visualize the data. For that we can use Grafana, which is easy to integrate since it has built in InfluxDB support. For more info how to point your Grafana instance to read the data from InfluxDB, check out https://powerapi-ng.github.io/grafana.html

References:

power's People

Contributors

fmuyassarov avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.