From 6486ed92ec6e04d5fc7781da3dbf7459ecade2f6 Mon Sep 17 00:00:00 2001 From: Eva Sebestova Date: Thu, 12 Oct 2023 13:51:47 +0200 Subject: [PATCH 1/3] subs instances --- nise/report.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nise/report.py b/nise/report.py index 54d3ad576..5007d755b 100644 --- a/nise/report.py +++ b/nise/report.py @@ -655,10 +655,15 @@ def aws_create_report(options): # noqa: C901 attributes, options.get("aws_tags"), ) - num_instances = 1 if attributes else randint(2, 60) - for _ in range(num_instances): + # num_instances - spec. how many times you want to multiple the yaml file - use 25000 for subs pref testing (have 2 rhel instance in yaml) + num_instances = 1000 if attributes else randint(2, 60) + for i in range(num_instances): + resource_id = "i-{}".format(fake.ean8()) for hour in gen.generate_data(): + hour['lineItem/ResourceId'] = resource_id data += [hour] + + if len(data) == options.get("row_limit"): file_number += 1 month_output_file = write_aws_file( From d7fb00cefc4ea573f70d1937e45d034c775fc379 Mon Sep 17 00:00:00 2001 From: Eva Sebestova Date: Thu, 12 Oct 2023 21:41:47 +0200 Subject: [PATCH 2/3] row limit --- nise/report.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nise/report.py b/nise/report.py index 5007d755b..1c98b1a89 100644 --- a/nise/report.py +++ b/nise/report.py @@ -655,8 +655,8 @@ def aws_create_report(options): # noqa: C901 attributes, options.get("aws_tags"), ) - # num_instances - spec. how many times you want to multiple the yaml file - use 25000 for subs pref testing (have 2 rhel instance in yaml) - num_instances = 1000 if attributes else randint(2, 60) + # num_instances - spec. how many times you want to multiple the whole yaml file + num_instances = 10000 if attributes else randint(2, 60) for i in range(num_instances): resource_id = "i-{}".format(fake.ean8()) for hour in gen.generate_data(): @@ -664,7 +664,7 @@ def aws_create_report(options): # noqa: C901 data += [hour] - if len(data) == options.get("row_limit"): + if len(data) == 500000: # options.get("row_limit"): file_number += 1 month_output_file = write_aws_file( file_number, From 851d9c316a31f3f60f2ad5b246b25c56febb5581 Mon Sep 17 00:00:00 2001 From: Eva Sebestova Date: Thu, 15 Feb 2024 17:57:50 +0100 Subject: [PATCH 3/3] small update --- nise/report.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nise/report.py b/nise/report.py index 1c98b1a89..cc793cf9d 100644 --- a/nise/report.py +++ b/nise/report.py @@ -655,16 +655,20 @@ def aws_create_report(options): # noqa: C901 attributes, options.get("aws_tags"), ) - # num_instances - spec. how many times you want to multiple the whole yaml file + # TODO PERF_NOTE: update num_instances - how many times you want to multiple the whole yaml file num_instances = 10000 if attributes else randint(2, 60) for i in range(num_instances): - resource_id = "i-{}".format(fake.ean8()) + + if attributes.get("resource_id"): + resource_id = f"{attributes.get('resource_id')}_{i}" + else: + resource_id = "i-{}".format(fake.ean8()) + for hour in gen.generate_data(): - hour['lineItem/ResourceId'] = resource_id + hour["lineItem/ResourceId"] = resource_id data += [hour] - - if len(data) == 500000: # options.get("row_limit"): + if len(data) == options.get("row_limit"): file_number += 1 month_output_file = write_aws_file( file_number,