Permalink
Browse files

analyze_logfile_object hook

  • Loading branch information...
1 parent db43db3 commit 4c5598d9a593e20b18343ea339555d928ac13b97 @esedor esedor committed Feb 11, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 dex/dex.py
View
@@ -240,6 +240,19 @@ def analyze_logfile(self, logfile_path):
return 0
############################################################################
+ def analyze_logfile_object(self, file_object):
+ """Analyzes queries from a given log file"""
+ run_stats = self._get_initial_run_stats()
+ log_parser = LogParser()
+
+ # For each line in the logfile ...
+ for line in file_object:
+ self._process_query(line, log_parser, run_stats)
+ self._output_aggregated_report(sys.stdout, run_stats)
+
+ return 0
+
+ ############################################################################
def watch_logfile(self, logfile_path):
"""Analyzes queries from the tail of a given log file"""
run_stats = self._get_initial_run_stats()

0 comments on commit 4c5598d

Please sign in to comment.