Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Stat:
- def __init__(self):
- self.parser = Parser()
- self.log_expl = LogExplorer()
- def add_line(self, line: str):
- log = self.parser.parse_log(line)
- if not log:
- return
- self.log_expl.add_log(log)
- def results(self) -> dict:
- return {
- 'FastestPage': self.log_expl.get_fastest_page(),
- 'MostActiveClient': self.log_expl.get_most_active_client(),
- 'MostActiveClientByDay':
- self.log_expl.get_most_active_client_on_date(),
- 'MostPopularBrowser': self.log_expl.get_most_active_browser(),
- 'MostPopularPage': self.log_expl.get_most_popular_page(),
- 'SlowestAveragePage': self.log_expl.get_avg_slowest_page(),
- 'SlowestPage': self.log_expl.get_slowest_page()}
- def make_stat():
- return Stat()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement