Skip to content

Commit c09eecf

Browse files
authored
Merge pull request #18 from powerapi-ng/revert-15-7_doc/nld_proofread
Revert "7_doc/nld proofread"
2 parents 3b74831 + 66d83fc commit c09eecf

25 files changed

+464
-3549
lines changed

README.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,3 @@
22
PowerAPI website use [MKDocs](https://www.mkdocs.org/).
33

44
You can push your changes on `master` branch to deploy them on the website.
5-
6-
## Local development
7-
8-
When redacting changes for this documentation, you may want to visualize the
9-
output the way it will be presented in the final website once compiled.
10-
11-
One way to do so is to:
12-
13-
1. Install the necessary packages : mkdocs, mkdocs-material, mkdocs-material-extensions
14-
This can be done with: `pip install mkdocs mkdocs-material mkdocs-material-extensions`
15-
16-
2. Have a local copy of this repository (taking care of *checkout-ing* the right ref)
17-
18-
3. From the CLI, have this particular repository as PWD
19-
20-
4. Use mkdocs in order to serve locally (default on http://localhost:8000)
21-
This can be done with: `mkdocs serve -o`
22-
23-
5. Check the URL it serves to, targets will be rebuild on modifications in the
24-
current directory or in any nested elements (use -W to add paths to be considered for hot reloading)

docs/assets/images/reference/sensors/PowerAPI_HWPCSensorOverview.drawio

Lines changed: 0 additions & 99 deletions
This file was deleted.

docs/assets/images/reference/sensors/PowerAPI_HWPCSensorOverview.drawio.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/getting_started.md

Lines changed: 37 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,57 @@
11
# Getting started
22

3-
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
65

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).
159

16-
## Which components to get a complete stack
1710

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**
1913
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
2216
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.
2620
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.
3222
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+
-->
3426

35-
You can either download the archive by cloning the repository or using wget.
27+
## **SmartWatts Formula**
3628

37-
=== "git"
38-
```sh
39-
git clone https://github.com/powerapi-ng/powerapi-ng.github.io.git
40-
cd powerapi-ng.github.io/docs/script/getting-started
41-
```
29+
!!! note ""
30+
for monitoring the power consumption of your process
4231

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.
4836

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.
5138

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.
6641

67-
#### HWPC-Sensor and SmartWatts Configuration
6842

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.
7143

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).
7446

47+
<!---
48+
## **Jouleit**
7549
76-
## Turn the key
50+
!!! note ""
51+
for mesuring the energy consumption of a program
7752
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)
56+
Start jouleit by using `./jouleit.sh cmd`.
57+
-->

docs/reference/database/sources_destinations.md

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
1-
# Storage Options
1+
# Sources and Destinations
22

3-
Different storage options are available to serve different purpose both for [Sensors](../overview.md#Sensor) and [Formulas](../overview.md#Formula).
3+
A PowerAPI Formula uses Sources and Destinations in order to retrieve metrics and store estimations.
44

5-
Storage is needed to save reports produced by each components.
6-
- Sensors store their usage reports
7-
- Formulas retrieve usage reports and store energy consumption reports
8-
- Visualization tools or individuals need to access reports for analysis
5+
For each Source/Destination the parameters to specify are different. For each one of them,
6+
its parameters are specified in following sections.
97

108
## Summary
11-
12-
The following table defines the existing storage options for Sensors usage reports :
13-
14-
| Name | CLI `ouput` parameter value | JSON `type` tag parameter value|
15-
| ------------ | --------------------------------------| -------------------------------------------|
16-
| MongoDB | mongodb | mongodb |
17-
| CSV | csv | csv |
18-
| Socket | socket | socket |
19-
| File Database | filedb | filedb |
20-
9+
| Name | Source | Destination | CLI `input`/`ouput` parameter value | JSON `type` tag parameter value |
10+
| ------------- | ----- | ------------- | ------------- | ------------------------------------ |
11+
| MongoDB | Yes | Yes | mongodb | mongodb |
12+
| InfluxDB2 | No | Yes | influxdb2 | influxdb2 |
13+
| CSV | Yes | Yes | csv | csv |
14+
| Socket | Yes | No | socket | socket |
15+
| File Database | Yes | Yes | filedb | filedb |
16+
| Prometheus | No | Yes | prometheus | prometheus |
2117

2218
## MongoDB
2319

@@ -34,7 +30,7 @@ The list of accepted parameters are:
3430
|`db` (`database` for `HWPCSensor`) | string | `d` (`D` for `HWPCSensor`) | N/A | Yes | The name of your database |
3531
|`collection` | string | `c` (`C` for `HWPCSensor`) | N/A | Yes | The name of the collection inside `db` |
3632
|`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 |
3834

3935
### JSON File Excerpt
4036

@@ -68,7 +64,7 @@ The list of accepted parameters are:
6864
|`org` | string | `g` | N/A | Yes | The name of the organization associated to the bucket |
6965
|`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 |
7066
|`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 |
7268

7369

7470
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.
7975

8076
```json
8177
{
82-
"model": "Power Report",
78+
"model": "PowerReport",
8379
"type": "influxdb2",
8480
"uri": "http://127.0.0.1",
8581
"port": 8086,
@@ -104,7 +100,7 @@ The list of accepted parameters are:
104100
|`files`(Source)| string | `f` | Empty list | No | The list of input CSV files with the format file1,file2,file3... |
105101
|`directory` (Destination and `HWPCSensor`)| string |`d` (`U` for `HWPCSensor`) | Current directory | No |The directory where output CSV files will be written |
106102
|`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` |
108104

109105
### JSON File Excerpt
110106

@@ -132,7 +128,7 @@ The list of accepted parameters are:
132128
|`port` | int | `P` | N/A | Yes | The port of communication |
133129
|`uri`/ `host` | int | `U` | N/A | Yes | The IP address of the machine running the socket |
134130
|`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 |
136132

137133

138134
### JSON File Excerpt
@@ -162,7 +158,7 @@ The list of accepted parameters are:
162158
| ------------- | ----- | ------------- | -------------| ---------- | ------------------------------------ |
163159
|`filename` | int | `f` | N/A | Yes | The name of the file |
164160
|`name` | string | `n` | `"pusher_filedb"` | No | The related pusher name |
165-
|`model` | string | `m` | `"HWPC Report"` (Source) `"Power Report"` (Destination)| No | The Report type stored in the file |
161+
|`model` | string | `m` | `"HWPCReport"` (Source) `"PowerReport"` (Destination)| No | The Report type stored in the file |
166162

167163
### JSON File Excerpt
168164

@@ -192,7 +188,7 @@ The list of accepted parameters are:
192188
|`metric-name` | string | `M` | N/A | Yes | The exposed metric name |
193189
|`metric-description` | string | `d` | `"energy consumption"` | No | The exposed metric description |
194190
|`name` | string | `n` | `"pusher_prom"` | No | The related pusher name |
195-
|`model` | string | `m` | `"Power Report"` | No | The Report type exposed by Prometheus |
191+
|`model` | string | `m` | `"PowerReport"` | No | The Report type exposed by Prometheus |
196192

197193

198194
Prometheus can only be used as a Destination that monitors reports but they will be not stored by this service.

docs/reference/formulas/configuration_files.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ The table below shows basic parameters.
1111
| `verbose` | `bool` (flag) | `v` |`NOTSET` | Verbose or quiet mode |
1212
| `stream` | `bool` (flag) | `s` |`False` | Real time or post-mortem mode |
1313
| `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)|
1616
| `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) |
1717
| `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) |
1818

19+
???+ tip "Sources and Destinations' values"
20+
- Sources: `mongodb`, `csv`, `socket`, `filedb`
21+
- Destinations: `mongodb`, `influxedb`, `influxedb2`, `csv`, `socket`, `filedb`, `prom`
1922

2023
???+ tip "Processors' values"
2124
- Pre-Processors: `k8s`, `libvirt`
@@ -49,5 +52,5 @@ PowerAPI Formulas use `json` files. These files follow the next template:
4952
$formula_parameters
5053
}
5154
```
52-
???+ info "input and output' `json` tags"
55+
???+ info "Sources and Destinations' `json` tags"
5356
More information related to `json` tags for each Source/Destination can be found [here](../database/sources_destinations.md)

0 commit comments

Comments
 (0)