Simple python application that takes a file path and parses it with a known comma delineated schema. Once it's parsed we take a look at the data in aggregate and format it accordingly.
Only Python requirement is a module called attrs which reduces boiler plate code without sacrificing performance.
Code is written to target python >3.8.9
python3 -m venv .venv
source ./.venv/bin/activate
pip install -r requirements.txt
python Main.py <file_path>
e.g. python Main.py ~/dev/jhickman-python-log-parsing/fake_msgs.log
Code output should resemble the following:
n32: Average: 92.52 Max: 100.0 Min: 73.0
n29: Average: 87.23 Max: 100.0 Min: 46.0
n30: Average: 85.83 Max: 100.0 Min: 44.0
...
Execute tests:
python -m unittest MetricCollecting.tests.TestProcessor -v
./app
- Contains core processing code
./tests
- Contains unit tests
Primary entrypoint is from the root folder in Main.py
which takes a filepath argument and calls process_log
with output formatting.