<% from merescoharvester.harvester.throughputanalyser import ThroughputAnalyser if args.repositoryId: caption = args.repositoryId objectType = 'repository' elif args.repositoryGroupId: caption = args.repositoryGroupId objectType = 'repository group' else: caption = args.domainId objectType = 'domain' import time days = args.since == 'lastweek' and 7 or 31 dateSince = time.strftime("%Y-%m-%d", time.localtime(time.time() - days * 3600 * 24)) %>

<%= "Harvester throughput for the '%s' %s for the past %i days." % (caption, objectType, days) %>

<% #Determine all repository names. repositoryNames = [] getArgs = { 'verb': 'GetRepositoryGroups', 'domainId': args.domainId} groups = asxml(url('/saharaget?' + urlencode(getArgs))).saharaget.GetRepositoryGroups.repositoryGroup for repositoryGroup in groups: if not args.repositoryGroupId or args.repositoryGroupId == repositoryGroup.id: for repositoryId in repositoryGroup.repositoryId: if not args.repositoryId or args.repositoryId == repositoryId: repositoryNames.append(repositoryId) logDir = req.get_options()['logDir'] analyser = ThroughputAnalyser(logDir + '/' + args.domainId) report = analyser.analyse(repositoryNames, dateSince) %>
Timespan (hh:mm:ss): <%= report.hmsString() %>
Number of records: <%= report.records %> processed
Throughput (record/sec): <%= report.recordsPerSecond() %>
Extrapolated for 24 hours: <%= report.recordsPerDay() %>