add wip tsstats.log.parse_logs

This commit is contained in:
Thor77 2016-06-19 22:26:19 +02:00
parent 0c57b27abc
commit 612055a088
1 changed files with 14 additions and 0 deletions

View File

@ -27,6 +27,20 @@ TimedLog = namedtuple('TimedLog', ['path', 'timestamp'])
logger = logging.getLogger('tsstats')
def parse_logs(log_glob):
'''
parse logs from `log_glob`
'''
vserver_clients = {}
for virtualserver_id, logs in _sort_logfiles(log_glob):
clients = Clients()
for log in logs:
_parse_details(clients=clients)
if len(clients) >= 1:
vserver_clients[virtualserver_id] = clients
return vserver_clients
def _sort_logfiles(log_glob):
'''
collect logfiles from `log_glob` and sort them by date