-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A Faker test data generation tool with a simplistic performance test. #108
A Faker test data generation tool with a simplistic performance test. #108
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Justin Ohrenberger justinohrenberger@gmail.com
Signed-off-by: Justin Ohrenberger <justinohrenberger@gmail.com>
Signed-off-by: Justin Ohrenberger <justinohrenberger@gmail.com>
8185950
to
96aaf04
Compare
self.ChargePeriodStart = fake.date_time_this_month(before_now=True, after_now=False, tzinfo=None).isoformat() | ||
self.ChargePeriodEnd = fake.date_time_this_month(before_now=True, after_now=False, tzinfo=None).isoformat() | ||
self.BilledCost = fake.pyfloat(left_digits=3,right_digits=2, positive=True) | ||
self.AmortizedCost = fake.pyfloat(left_digits=3,right_digits=2, positive=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We renamed AmoirtizedCost to EffectiveCost i think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was pulled from https://github.com/finopsfoundation/focus_validator/blob/main/tests/samples/all_pass.csv
This aligns with: https://github.com/finopsfoundation/focus_validator/blob/main/focus_validator/rules/base_rule_definitions/FV-M002-0003.yaml
Happy to change the name in my code but there may be another inconsistency to correct.
Signed-off-by: Justin Ohrenberger <justinohrenberger@gmail.com>
Signed-off-by: Justin Ohrenberger <justinohrenberger@gmail.com>
…#108) Signed-off-by: Justin Ohrenberger <justinohrenberger@gmail.com>
…#108) Signed-off-by: Justin Ohrenberger <justinohrenberger@gmail.com>
While experimenting with Python and Faker I found that the test data samples could benefit from a more dynamic, scalable tool to more efficiently generate data on the fly.
csv_random_data_generator.py - This class has the Faker structure in place with several of the variables customized with AWS specific data. This lended to more realistic data generated at random. The bottom of the file includes several commands to generate an inital file (also attached) with 1000 records. There are opportunities to enhance it to include google or Azure options as well.
focus_validator_performance_test.py - Super simple performance test that exercises the 1,000 record csv to see what it's performance capabilities are. This can be enhanced for more complex scaling, created more for curiousity.
I am not a Python expert but thought the data generation would be useful for generating more interesting, on the fly, scaled data samples for testing.
Signed-off-by: Justin Ohrenberger justinohrenberger@gmail.com