Skip to content

NeverTheSame/Python-PerfReader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a Python script that processes log files from a support log (in ZIP format) to extract data about the performance of some system. Specifically, it processes proxy log files to extract information about the receive rate and saving rate of the system at different timestamps.

The script unzips the provided ZIP file containing the support log files, and extracts the log files to a directory called Extracted. The script then creates two CSV files to store the extracted data: receive.csv and saving.csv. The script processes each proxy log file in the Extracted directory, reads the data about the receive and saving rates, and writes this data to the respective CSV files.

After processing all proxy log files, the script reads the data from receive.csv and plots the receive rate against timestamps using Matplotlib.

The script can be executed from the command line by providing the path to the ZIP file containing the support log files as the first argument. If executed as a Docker container, the path to the logs.zip file can be mounted as a volume and provided as the logs.zip argument.

The script defines several helper functions, including:

  • unzip_logs(file_path): a function to unzip the support log file to the Extracted directory
  • create_csv_files(): a function to create the receive.csv and saving.csv files
  • process_proxy_files(): a function to process the proxy log files and write the receive and saving rates to their respective CSV files
  • get_rate(log_line, pattern_to_find): a function to extract the rate value from a log line given a pattern to find
  • get_date_string(log_line): a function to extract the date string from a log line
  • plot(): a function to read the data from receive.csv and plot the receive rate against timestamps using Matplotlib.

The script also defines several global variables:

  • path_to_extracted_folder: the path to the directory where the log files are extracted
  • receive_file_path: the path to the receive.csv file
  • saving_file_path: the path to the saving.csv file

The script requires several Python packages to run, including zipfile, csv, re, collections, matplotlib, datetime, and numpy.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors