You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this tutorial, we will guide you through the first steps to get started with PowerAPI.
4
-
The objective is to get a quick view of the capabilities of PowerAPI, by monitoring a process and getting a quick glimpse at the energy consumption.
5
-
A few things are required before we start:
3
+
If you want to monitor the energy consumption of your process we have some
4
+
ready-to-use tools
6
5
7
-
- A compatible processor (you can see the compatible CPU architecture [here](./reference/sensors/hwpc-sensor.md#)), and you can look on the following pages to find your CPU architecture:
8
-
* For [Intel Processor](https://en.wikipedia.org/wiki/List_of_Intel_processors)
9
-
* For [Intel Xeon Processor](https://en.wikipedia.org/wiki/List_of_Intel_Xeon_processors)
10
-
* For [AMD Processor](https://en.wikipedia.org/wiki/Table_of_AMD_processors)
11
-
- A python installation ready
12
-
- Docker & Docker-Compose ready (refer to [this official documentation](https://docs.docker.com/engine/install/) and the [post-install steps](https://docs.docker.com/engine/install/linux-postinstall/) if needed !)
13
-
- Root access
14
-
- Optional : [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) to proceed by cloning the repository
6
+
???+ info "Source and Destination"
7
+
In order to use any Formula, you need to run a Source and a Destination. The former is used by a Sensor to store metrics. The later allows the Formula to make available the estimations. For starting, you can use [MongoDB](https://hub.docker.com/_/mongo) as Source and [InfluxDB:2.X](https://hub.docker.com/_/influxdb) as Destination by installing them as Docker containers.
8
+
For more details about Sources and Destinations please check this [section](reference/database/sources_destinations.md).
15
9
16
-
## Which components to get a complete stack
17
10
18
-
If you wish to get started as soon as possible, the archive below will allow you to deploy the following elements:
11
+
<!---
12
+
## **RAPL Formula**
19
13
20
-
1. A MongoDB instance to store the [Sensor](./reference/sensors/hwpc-sensor.md)
21
-
Reports
14
+
!!! note ""
15
+
for monitoring the energy consumption of your device
22
16
23
-
3. An [HWPC-Sensor](./reference/sensors/hwpc-sensor.md) that outputs its
24
-
[HWPC Reports](./reference/reports/reports.md#hwpc-reports) in a MongoDB Database,
25
-
within the HWPC Report Collection
17
+
RAPL Formula is made for tracking the energy consumption of your machine.
18
+
To install RAPL Formula on a baremetal server or a PC run [the following
19
+
script](script/rapl_install.sh) in a Terminal.
26
20
27
-
4. A [SmartWatts](./reference/formulas/smartwatts.md) that streams the
28
-
[HWPC Reports](./reference/reports/reports.md#hwpc-reports) from the MongoDB
29
-
Database Collection, processes it and outputs its
30
-
[Power Reports](./reference/reports/reports.md#power-reports) as CSV files for a
31
-
quick glimpse
21
+
The script explains what it will do and then pauses before it does it.
32
22
33
-
## Preparation
23
+
Please notice that you need a **Linux distribution** in order to use the HWPC Sensor installed by the script as
24
+
well as a **comptible Intel** (Sandy Bridge and newer) or **AMD Processor** (Zen). **Power/ARM/RISCV are not supported** architectures. HWPC Sensor will **not work on a Virtual Machine**. However, you can install the Formula by hand in a Virtual Machine if need it.
25
+
-->
34
26
35
-
You can either download the archive by cloning the repository or using wget.
cd powerapi-ng.github.io/docs/script/getting-started
41
-
```
29
+
!!! note ""
30
+
for monitoring the power consumption of your process
42
31
43
-
=== "wget"
44
-
```
45
-
wget -c https://raw.githubusercontent.com/powerapi-ng/powerapi-ng.github.io/refs/heads/master/docs/script/getting_started.tar.gz -O - | tar -xz
46
-
cd getting_started
47
-
```
32
+
Smartwatts is made for tracking the power consumption of processes on a
33
+
machine.
34
+
To install Smartwatts on a baremetal server or a PC run [the following
35
+
script](script/smartwatts_install.sh) in a Terminal. Please notice that you will need [pip](https://pip.pypa.io/en/stable/installation/) or [docker](https://docs.docker.com/engine/install/) in order to use the Formula.
48
36
49
-
At this stage, you will have all the essential files to begin. Let's go through each element in detail.
50
-
### Archive content
37
+
The script explains what it will do and then pauses before it does it.
51
38
52
-
```sh
53
-
getting_started/
54
-
|--csv/
55
-
|--formula/
56
-
|----smartwatts-mongodb-csv.json
57
-
|--sensor/
58
-
|----hwpc-mongodb.json
59
-
|--start.sh
60
-
|--start.py
61
-
|--stop.sh
62
-
|--pretty_print.py
63
-
|--docker-compose.yaml
64
-
|--.env
65
-
```
39
+
Please notice that you need a **Linux distribution** in order to use the HWPC Sensor installed by the script as
40
+
well as a **comptible Intel** (Sandy Bridge and newer) or **AMD Processor** (Zen). You also need [docker](https://docs.docker.com/engine/install/). **Power/ARM/RISCV are not supported** architectures. HWPC Sensor will **not work on a Virtual Machine**. However, you can install the Formula by hand in a Virtual Machine if need it.
66
41
67
-
#### HWPC-Sensor and SmartWatts Configuration
68
42
69
-
As described in the [HWPC-Sensor Documentation](./reference/sensors/hwpc-sensor.md#global-parameters) and in the [SmartWatts Documentation](./reference/formulas/smartwatts.md#global-parameters),
70
-
several parameters can be set, both globally and for specific Groups monitored for the sensor or the formula.
71
43
72
-
The provided docker-compose.yaml file uses configuration files and the **.env** to set those parameters.
73
-
You can find examples of both those configuration files in the archive under the **formula** and **sensor**directories.
44
+
#### CGroups
45
+
If you need to monitor a process or a group of process via SmartWatts by using HWPC Sensor **version 1.2 or older**, you can follow this [tutorial](reference/cgroup/cgroup.md). Please notice that **cgroup V1** is required **only**for HWPC Sensor **version 1.2 or older**. If you need to enable this `cgroup` version please follow this [tutorial](reference/cgroup/cgroup_v1_activation.md).
74
46
47
+
<!---
48
+
## **Jouleit**
75
49
76
-
## Turn the key
50
+
!!! note ""
51
+
for mesuring the energy consumption of a program
77
52
78
-
Once all set, you shall be able to initiate the stack with:
79
-
80
-
```sh
81
-
python3 start.py
82
-
```
83
-
84
-
After the 2 minutes of monitoring, you will be able to see the result inside the **csv** directory.
85
-
If you have trouble understanding the output, you can read the [Power Report documentation](./reference/reports/reports.md#power-reports).
86
-
87
-
!!! info "Quick results overview"
88
-
Only in the context of this testing archive, after the monitoring, you can use the following command to get a pretty print of the result directly inside the terminal.
89
-
90
-
```sh
91
-
python3 pretty_print.py
92
-
```
53
+
Jouleit is made for tracking the energy consumption of a program.
54
+
Jouleit need `gawk` to run.
55
+
You can get the script from the [github repository](https://github.com/powerapi-ng/jouleit)
@@ -34,7 +30,7 @@ The list of accepted parameters are:
34
30
|`db` (`database` for `HWPCSensor`) | string |`d` (`D` for `HWPCSensor`) | N/A | Yes | The name of your database |
35
31
|`collection`| string |`c` (`C` for `HWPCSensor`) | N/A | Yes | The name of the collection inside `db`|
36
32
|`name`| string |`n`|`"puller_mongodb"` (Source), `pusher_mongodb` (Destination)| No | The related puller/pusher name. This parameter is not used by `HWPCSensor`|
37
-
|`model`| string |`m`|`"HWPC Report"` (Source), `Power Report` (Destination) | No | The Report type stored by the database |
33
+
|`model`| string |`m`|`"HWPCReport"` (Source), `PowerReport` (Destination) | No | The Report type stored by the database |
38
34
39
35
### JSON File Excerpt
40
36
@@ -68,7 +64,7 @@ The list of accepted parameters are:
68
64
|`org`| string |`g`| N/A | Yes | The name of the organization associated to the bucket |
69
65
|`tags`| string |`t`| N/A | No | List of metadata keys of the report separated by `,` that will be kept. `sensor` and `target` are always kept as report metadata |
70
66
|`name`| string |`n`|`"pusher_influxdb2"`| No | The related pusher name |
71
-
|`model`| string |`m`|`"Power Report"`| No | The Report type stored by the database |
67
+
|`model`| string |`m`|`"PowerReport"`| No | The Report type stored by the database |
72
68
73
69
74
70
InfluxDB2 can only be used as a Destination.
@@ -79,7 +75,7 @@ Below you find an example of configuration excerpt for this kind of Destination.
79
75
80
76
```json
81
77
{
82
-
"model": "Power Report",
78
+
"model": "PowerReport",
83
79
"type": "influxdb2",
84
80
"uri": "http://127.0.0.1",
85
81
"port": 8086,
@@ -104,7 +100,7 @@ The list of accepted parameters are:
104
100
|`files`(Source)| string |`f`| Empty list | No | The list of input CSV files with the format file1,file2,file3... |
105
101
|`directory` (Destination and `HWPCSensor`)| string |`d` (`U` for `HWPCSensor`) | Current directory | No |The directory where output CSV files will be written |
106
102
|`name`| string |`n`|`"puller_csv"` (Source), `"pusher_csv"` (Destination)| No | The related puller/pusher name. This parameter is not used by `HWPCSensor`|
107
-
|`model`| string |`m`|`"HWPC Report"` (Source), `"Power Report"` (Destination) | No | The Report type stored in CSV files. This parameter is not used by `HWPCSensor`|
103
+
|`model`| string |`m`|`"HWPCReport"` (Source), `"PowerReport"` (Destination) | No | The Report type stored in CSV files. This parameter is not used by `HWPCSensor`|
108
104
109
105
### JSON File Excerpt
110
106
@@ -132,7 +128,7 @@ The list of accepted parameters are:
132
128
|`port`| int |`P`| N/A | Yes | The port of communication |
133
129
|`uri`/ `host`| int |`U`| N/A | Yes | The IP address of the machine running the socket |
134
130
|`name`| string |`n`|`"puller_socket"`| No | The related puller name |
135
-
|`model`| string |`m`|`"HWPC Report"`| No | The Report type managed by the socket |
131
+
|`model`| string |`m`|`"HWPCReport"`| No | The Report type managed by the socket |
136
132
137
133
138
134
### JSON File Excerpt
@@ -162,7 +158,7 @@ The list of accepted parameters are:
Copy file name to clipboardExpand all lines: docs/reference/formulas/configuration_files.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,14 @@ The table below shows basic parameters.
11
11
|`verbose`|`bool` (flag) |`v`|`NOTSET`| Verbose or quiet mode |
12
12
|`stream`|`bool` (flag) |`s`|`False`| Real time or post-mortem mode |
13
13
|`sensor-report-sampling-interval`|`int`| N/A |`1000`| The time in milliseconds between two reports (`stream` = `True`) |
14
-
|`input`|`string`| N/A | N/A |SmartWatts input, shall match an existing Sensor output and contain HPWCReports. See [here](./smartwatts.md#smartwatts-inputs)|
15
-
|`output`|`string`| N/A | N/A |SmartWatts output to store Power Report. See [here](./smartwatts.md#smartwatts-outputs)|
14
+
|`input`|`string`(Source)| N/A | N/A |Source used as input. More information about Sources and their related parameters can be found [here](../database/sources_destinations.md)|
15
+
|`output`|`string`(Destination)| N/A | N/A |Destination used as output. More information about Destinations and their related parameters can be found [here](../database/sources_destinations.md)|
16
16
|`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](../processors/processors.md)|
17
17
|`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/processors.md)|
0 commit comments