Skip to content

Commit

Permalink
Allow sending subsets
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Aug 4, 2017
1 parent 70f4bc9 commit 5ed50db
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/grt.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ def main(argv):
help="Set the logging level", default='warning')
parser.add_argument("-b", "--batch-size", type=int, default=1000,
help="Batch size for sql queries")
parser.add_argument("-m", "--max-records", type=int, default=0,
help="Maximum number of records to include in a single report. This option should ONLY be used when reporting historical data. Setting this may require running GRT multiple times to capture all historical logs.")

args = parser.parse_args()
logging.getLogger().setLevel(getattr(logging, args.loglevel.upper()))
Expand Down Expand Up @@ -244,6 +246,11 @@ def annotate(label, human_label=None):
# So we can just quit now.
sys.exit(0)

# Allow users to only report N records at once.
if args.max_records > 0:
if end_job_id - last_job_sent > args.max_records:
end_job_id = last_job_sent + args.max_records

# Unfortunately we have to keep this mapping for the sanitizer to work properly.
job_tool_map = {}
blacklisted_tools = config['sanitization']['tools']
Expand Down

0 comments on commit 5ed50db

Please sign in to comment.