Skip to content

Instantly share code, notes, and snippets.

@vedgar
Created July 1, 2017 17:32
Show Gist options
  • Select an option

  • Save vedgar/1975ab63dd67b94308ce170f0a5f46c5 to your computer and use it in GitHub Desktop.

Select an option

Save vedgar/1975ab63dd67b94308ce170f0a5f46c5 to your computer and use it in GitHub Desktop.
from collections import Counter
bandwidth_totals, server_counter = Counter(), Counter()
if server is None:
for entry in daily_log:
items = entry.split()
server_name, bandwidth = items[1], items[15]
if bandwidth != 'NULL': # ignore older logs that don't have current format
bandwidth_totals[server_name] += int(bandwidth)
server_counter[server_name] += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment