hgext/serverlog/scripts/repo-totals-by-hour.py [10:30]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def totals_by_hour(fh):
    hours = {}

    for line in fh:
        parts = line.rstrip().split()

        try:
            when, repo, ip, command, size, t_wall, t_cpu = parts
            try:
                when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S.%f")
            except ValueError:
                when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S")
        except (TypeError, ValueError):
            continue

        size = int(size)
        t_wall = float(t_wall)
        t_cpu = float(t_cpu)

        t = when.time().replace(minute=0, second=0, microsecond=0)
        when = when.combine(when.date(), t)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



hgext/serverlog/scripts/totals-by-hour.py [10:30]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def totals_by_hour(fh):
    hours = {}

    for line in fh:
        parts = line.rstrip().split()

        try:
            when, repo, ip, command, size, t_wall, t_cpu = parts
            try:
                when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S.%f")
            except ValueError:
                when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S")
        except (TypeError, ValueError):
            continue

        size = int(size)
        t_wall = float(t_wall)
        t_cpu = float(t_cpu)

        t = when.time().replace(minute=0, second=0, microsecond=0)
        when = when.combine(when.date(), t)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



