Skip to content
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

New feature: reserved_hourly_combinations #27

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

InternetExplorer7
Copy link

@InternetExplorer7 InternetExplorer7 commented Oct 10, 2018

A new feature in the EC2Offer class. The function is called reserved_hourly_combinations. Given a single input instance_name, this function will output all valid combinations (region, lease contract length, offering class, purchase option) along with the cost for each combination in a combined output (in the form of an array of objects).

Future: I'd love to see this tool become more accessible to more people over time, such as entry-level developers or even those who have very little to no development skills! This repository makes a healthy step towards that goal, and I believe my function gets us even one step closer to that goal by minimizing the number of required parameters to 1 for EC2 hourly pricing, I'd love to get to the point where we can require an easier set of parameters (assuming our users aren't familiar with AWS's vocabulary [such as EC2 instance names]) and use those custom parameters to find an optimal subset of configurations from our full set of configurations, and then return that!

Another new feature to the EC2Offer class is reserved_hourly_combinations_kthclosest. Given the output of reserved_hourly_combinations as its input, this function will output the kth-cheapest option in avg. case linear time (QuickSelect). This can be used in a loop to find the kth cheapest configurations given a set of configurations. When cases where the cheapest configuration doesn't work and more {CPU, memory, network throughput} is required, this function can be used to quickly find the most optimal EC2 instance type, region and more while minimizing cost and time.

Future: While QuickSelect works well in most cases, it does technically have an upper-bound runtime of O(n^2) in the case that we choose a bad pivot every time (e.g. for each partition, the value of our pivot is the largest element in our array). This can be alleviated by using LinearSelect, which uses a median of n/5 medians as our pivot. LinearSelect has a worst-case running time of O(n). QuickSelect has an avg. case running time of O(n) but a worst-case running time of O(n^2).

tesz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant