how to write script?

April 4, 2011 at 14:39:06
Specs: Windows Vista
Assume you have to parse log files containing query execution metadata. The files are pipe-delimited containing Start Timestamp, Query Name, and Duration columns, and contain a header row. Write a script that outputs a report with the top 5 longest durations (ordered highest-to-lowest) and the top 5 most frequent queries (ordered highest-to-lowest) run on a given day. The report should be fixed-width formatted

See More: how to write script?

Report •

#1
April 4, 2011 at 15:22:53
Can you provide a sample of your flat file?

Report •

#2
April 4, 2011 at 15:31:50
START|QUERY|DURATION_IN_MILLIS
2011-10-21 21:40:13,150|ping|1
2011-10-21 21:48:54,174|get-all-ua|46
2011-10-21 21:48:54,222|get-all-ua|29
2011-10-21 21:48:54,436|get-all-ua|22
2011-10-21 21:48:54,460|get-all-ua|22
2011-10-21 22:00:09,925|get-tool-info-by-t|269
2011-10-21 22:00:10,242|get-tool-info-by-t|183
2011-10-21 22:00:11,253|get-latest-ps|86
2011-10-21 22:00:11,376|get-latest-ps|77
2011-10-21 22:00:11,484|get-all-Us|6
2011-10-21 22:00:27,709|get-Cs|60
2011-10-21 22:00:27,892|getDataHList|18
2011-10-21 22:00:28,820|get-tools-by-U|30
2011-10-21 22:00:28,855|get-tools-by-U|268
2011-10-21 22:00:29,298|get-tools-by-id|13

Report •
Related Solutions


Ask Question