This files used the Precision Time Protocol(PTP) according to IEEE standard 1588 for Linux.
It contains log files that are generated at a specified time and analyzed and visualized.
Master OS : Ubuntu20.04LTS
Slave OS : Ubuntu18.04LTS
python version : 3.6
Slave Bash version : 4.4.20
The PATH in the code must be modified according to the user's system.
The master computer's ptp4l service must always be running.
- Run run.sh in the terminal command.
./run.sh
- When the ptp4l service ends, Input the file name to convert JSON file to csv
- When the file name is entered, check the created txt and JSON files.
- A csv file is created
- A txt file is read to output the convergence index and offset
- Run findConvergence.py in the terminal command.
./findConvergence.py
-
You need to view the contents of the code and modify the PATH of the txt file
-
This python code analyzes a txt file and outputs the index and offset of the converged section.
- Run jsonToCsv.py in the terminal command.
- This python code converts log files output in JSON format to csv files.
./jsonTocsv.py
- You need to view the contents of the code and modify the PATH of the JSON file
- Run csv_Visualization.ipynb in the jupyter-notebook
- This file visualizes the data via csv file.
jupyter-notebook
- You need to view the contents of the code and modify the PATH of the csv file
This shell code runs on the slave.
This program runs the 'ptp4l' service for 5min and stops it.
The log of the service is saved as a txt file and a JSON file through redirection.
(Use journalctl to print the system log as a JSON file.)
The JSON file has TIMESTAMP, but the txt file has no time variable.
When the offset is constant below 1000, set to convergence.
This file compares the offset values of the txt file and judges that it is convergence.
This file converts JSON file to csv.
This file visualizes the data.