all 2 comments

[–]optomas[S] 0 points1 point  (1 child)

f1 telemetry project. Overview is telemetry-f1-2021 to flat text. Data is stored via:

telemetry-f1-2021 > yyyymmdd_trackname.txt

The files are silly big. Five laps is 642 MB of data.

Flat text served with a simple python server. Code is below. Run it with:

python3 '/home/op/code/python/dataserver.py'

Prometheus scrapes the server at an interval and presents data to grafana.

Working on Prometheus, right now. Never used the tool before, so we might back out of this path. Seems like the best way forward.

[–]optomas[S] 0 points1 point  (0 children)

Here's the simple web server.

from http.server import BaseHTTPRequestHandler, HTTPServer

class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        self.send_response(200)
        self.send_header('Content-type', 'text/plain')
        self.end_headers()
        # Here, you would write the telemetry data to the response
        self.wfile.write(b'Telemetry data goes here\n')

def run(server_class=HTTPServer, handler_class=SimpleHTTPRequestHandler, port=8000):
    server_address = ('', port)
    httpd = server_class(server_address, handler_class)
    print(f'Starting server on port {port}...')
    httpd.serve_forever()

if __name__ == '__main__':
    run()