- Add a log entry for repo verb handling and make the container usage calculation take it into account

- Move all the repo push/pull/verb logging into a central track_and_log method
- Readd images accidentally deleted in the last CL
- Make the uncompressed size migration script better handle exceptions
This commit is contained in:
Joseph Schorr 2014-10-29 15:42:44 -04:00
parent c65031eea5
commit c1398c6d2b
18 changed files with 216 additions and 85 deletions

View file

@ -2226,7 +2226,10 @@ def confirm_team_invite(code, user):
def get_repository_usage():
repo_pull = LogEntryKind.get(name = 'pull_repo')
return (LogEntry.select().where(LogEntry.kind == repo_pull, ~(LogEntry.repository >> None))
repo_verb = LogEntryKind.get(name = 'repo_verb')
return (LogEntry.select()
.where((LogEntry.kind == repo_pull) | (LogEntry.kind == repo_verb))
.where(~(LogEntry.repository >> None))
.group_by(LogEntry.ip)
.group_by(LogEntry.repository)
.count())