Skip to content

Latest commit

 

History

History
77 lines (53 loc) · 1.43 KB

README.md

File metadata and controls

77 lines (53 loc) · 1.43 KB

Prototype for PMU data analytics

Caution

This software is experimental and subject to change.

Getting started

Clone the entire repo

git clone https://github.com/G-PST/pmu-data-analytics.git

Running the CLI using cargo:

cargo run --help

How to ...

... start the Mock PDC server

cargo run mock-pdc

... start the Mock PDC server in a non-default IP/PORT

cargo run -- mock-pdc --ip localhost --port 8080

... start the PMU server

cargo run server

... start the PMU server and connect to a PDC

Assuming that the IP of the PDC server is 160.49.88.18 and the port enable is 3030

cargo run -- server --pdc-ip 160.49.88.18 --port 3030

... change the frequency of the PDC server

cargo run -- server --pdc-ip localhost --port 8080

... change the HTTP server port of the application

cargo run -- server --http-port 3030

... read the data from the PMU server in Python

While the server is running you can use Python to access the memory buffer using pandas:

import io
import pandas as pd
import requests

PORT = 8080  # Port where the Server was bind
url = f"http://127.0.0.1:{PORT}/data"
s = requests.get(url, timeout=10)
df = pd.read_feather(io.BytesIO(requests.get(url, timeout=10).content))
df.head()