A quick and dirty ruby script to extract all log entries denoting the completion of a NEOCAST job from a combined log
This program expects the full path of the combined log to parse as the first command line argument
This program will output to standard out Tab Delimited of the following:
- DateTime of log entry
- Job Name
- Job ID
- Job Duration
This program will also output the following headers for later analysis in a spreadsheet:
- Unique Job
- Min
- Max
- Average
- Job Count
An example of the entries the script will extract for Tab Delimited output:
Aug 10 06:24:34 localhost neocast-queue: 2020-08-10T06:24:34.993Z 18113 TID-goie5j8g5 Neocast::Gateway::Jobs::SaveLogsJob JID-aed615fc84305c5a7865f9ab INFO: done: 0.106 sec
The Tab Delimited output can be redirected to a file if desired for import into a spreadsheet program of choice for further analysis
If no command line argument is provided, the program will output a delimited list of the formula specified below that can be copy and pasted into cell E2
. For some reason, Google Sheets does not correctly utilize the formula if embedded directly in the initial tab-delimted output.
NOTE: I chose tab-delimited because the formulas contain commas which a CSV parser will break upon and render the formula useless.
Google Sheets snippets
Procedure to setup a Google Sheet
- Import the Tab Delimited output into a Google Sheet:
Replace Current Sheet
Tab
as delimiterYes
forConvert text to numbers
- Unique Job Listing - In cell
E2
paste the following formula:=UNIQUE(B2:B)
- Minimum Job Duration - In cell
F2
paste the following, deleting/adding as necessary:=MINIFS(D2:D, B2:B,E2)
=MINIFS(D2:D, B2:B,E3)
=MINIFS(D2:D, B2:B,E4)
=MINIFS(D2:D, B2:B,E5)
=MINIFS(D2:D, B2:B,E6)
=MINIFS(D2:D, B2:B,E7)
=MINIFS(D2:D, B2:B,E8)
=MINIFS(D2:D, B2:B,E9)
=MINIFS(D2:D, B2:B,E10)
=MINIFS(D2:D, B2:B,E11)
=MINIFS(D2:D, B2:B,E12)
=MINIFS(D2:D, B2:B,E13)
=MINIFS(D2:D, B2:B,E14)
=MINIFS(D2:D, B2:B,E15)
=MINIFS(D2:D, B2:B,E16)
=MINIFS(D2:D, B2:B,E17)
=MINIFS(D2:D, B2:B,E18)
=MINIFS(D2:D, B2:B,E19)
=MINIFS(D2:D, B2:B,E20)
=MINIFS(D2:D, B2:B,E21)
=MINIFS(D2:D, B2:B,E22)
=MINIFS(D2:D, B2:B,E23)
- Maximum Job Duration - In cell
G2
paste the following, deleting/adding as necessary:=MAXIFS(D2:D, B2:B,E2)
=MAXIFS(D2:D, B2:B,E3)
=MAXIFS(D2:D, B2:B,E4)
=MAXIFS(D2:D, B2:B,E5)
=MAXIFS(D2:D, B2:B,E6)
=MAXIFS(D2:D, B2:B,E7)
=MAXIFS(D2:D, B2:B,E8)
=MAXIFS(D2:D, B2:B,E9)
=MAXIFS(D2:D, B2:B,E10)
=MAXIFS(D2:D, B2:B,E11)
=MAXIFS(D2:D, B2:B,E12)
=MAXIFS(D2:D, B2:B,E13)
=MAXIFS(D2:D, B2:B,E14)
=MAXIFS(D2:D, B2:B,E15)
=MAXIFS(D2:D, B2:B,E16)
=MAXIFS(D2:D, B2:B,E17)
=MAXIFS(D2:D, B2:B,E18)
=MAXIFS(D2:D, B2:B,E19)
=MAXIFS(D2:D, B2:B,E20)
=MAXIFS(D2:D, B2:B,E21)
=MAXIFS(D2:D, B2:B,E22)
=MAXIFS(D2:D, B2:B,E23)
- Average Job Duration - In cell
H2
paste the following, deleting/adding as necessary:=AVERAGEIFS(D2:D, B2:B,E2)
=AVERAGEIFS(D2:D, B2:B,E3)
=AVERAGEIFS(D2:D, B2:B,E4)
=AVERAGEIFS(D2:D, B2:B,E5)
=AVERAGEIFS(D2:D, B2:B,E6)
=AVERAGEIFS(D2:D, B2:B,E7)
=AVERAGEIFS(D2:D, B2:B,E8)
=AVERAGEIFS(D2:D, B2:B,E9)
=AVERAGEIFS(D2:D, B2:B,E10)
=AVERAGEIFS(D2:D, B2:B,E11)
=AVERAGEIFS(D2:D, B2:B,E12)
=AVERAGEIFS(D2:D, B2:B,E13)
=AVERAGEIFS(D2:D, B2:B,E14)
=AVERAGEIFS(D2:D, B2:B,E15)
=AVERAGEIFS(D2:D, B2:B,E16)
=AVERAGEIFS(D2:D, B2:B,E17)
=AVERAGEIFS(D2:D, B2:B,E18)
=AVERAGEIFS(D2:D, B2:B,E19)
=AVERAGEIFS(D2:D, B2:B,E20)
=AVERAGEIFS(D2:D, B2:B,E21)
=AVERAGEIFS(D2:D, B2:B,E22)
=AVERAGEIFS(D2:D, B2:B,E23)
- Job Count - In cell
I2
paste the following, deleting/adding as necessary:=COUNTIFS(B2:B, E2)
=COUNTIFS(B2:B, E3)
=COUNTIFS(B2:B, E4)
=COUNTIFS(B2:B, E5)
=COUNTIFS(B2:B, E6)
=COUNTIFS(B2:B, E7)
=COUNTIFS(B2:B, E8)
=COUNTIFS(B2:B, E9)
=COUNTIFS(B2:B, E10)
=COUNTIFS(B2:B, E11)
=COUNTIFS(B2:B, E12)
=COUNTIFS(B2:B, E13)
=COUNTIFS(B2:B, E14)
=COUNTIFS(B2:B, E15)
=COUNTIFS(B2:B, E16)
=COUNTIFS(B2:B, E17)
=COUNTIFS(B2:B, E18)
=COUNTIFS(B2:B, E19)
=COUNTIFS(B2:B, E20)
=COUNTIFS(B2:B, E21)
=COUNTIFS(B2:B, E22)
=COUNTIFS(B2:B, E23)