The Rebellion Inc. has 7 data analysis applications. Each application runs in a loop waiting for its input data. Once the input data is available, it launches a job to process the data and produce output. Then it goes back to the loop waiting for next set of input data. Each application writes a message to a central operational log file, when a job is started, completed, or failed. Each message contains the timestamp when the event occurs, the application name followed by the job ID, event type, and the host name where the job is running on. The sample operational log file is attached.
In this assignment, you need to implement a program to compute for each application, the total number of jobs, number of failed jobs, and average duration of the jobs in seconds. You may assume that there are only 7 fixed applications with the names known in advance.
Your Python program has to meet the following requirements.
It takes the operational log file name as command line argument.
It prints out the summary report in the required format as shown in the sample output below.
The column of Job Name is 20 characters wide, and each of other columns is 10 characters wide.
The column headers are center aligned; the job names are left aligned; the numbers are right aligned.
Job | Total | Failed | Average
Name | Jobs | Jobs | Duration
A-Wing-Fighter | 1246| 4| 209
ARC-170-Starfighter | 844| 0| 187
B-Wing-Fighter | 963| 5| 133
Millennium-Falcon | 1| 0| 156
T-47-Airspeeder | 765| 3| 224
X-Wing-Fighter | 1772| 1| 98
Y-Wing-Fighter | 1260| 7| 234