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

Adding filter for only running non-spot instances and more price stats #127

Closed
wants to merge 1 commit into from
Closed

Adding filter for only running non-spot instances and more price stats #127

wants to merge 1 commit into from

Conversation

deinspanjer
Copy link
Contributor

No description provided.

@deinspanjer
Copy link
Contributor Author

I'm having trouble with the currently configured service (ec2-price.com) not returning data very often, but I figured I should paste an example of the new output anyway:

➜  awless git:(enhanced-pricer) awl inspect -i pricer
[info]    Running full sync before inspection (disable it with --local flag)

Fetching prices at http://ec2-price.com for region global

fetching price for 'm3.medium': strconv.ParseFloat: parsing "": invalid syntax
fetching price for 't2.small': strconv.ParseFloat: parsing "": invalid syntax
fetching price for 'm4.large': strconv.ParseFloat: parsing "": invalid syntax
fetching price for 't2.medium': strconv.ParseFloat: parsing "": invalid syntax
fetching price for 't2.micro': strconv.ParseFloat: parsing "": invalid syntax
fetching price for 't2.large': strconv.ParseFloat: parsing "": invalid syntax
fetching price for 't1.micro': strconv.ParseFloat: parsing "": invalid syntax

and the desired output:

Instance	Count		Price ea.	Estimated Total Cost (no EBS)
Type		Running		Per Hour	Per Day		Per Month
--------	-------		---------	-------		---------
m4.large	      1		 0.00000	    0.00	    0.00
t2.small	     12		 0.00000	    0.00	    0.00
t2.medium	      6		 0.00000	    0.00	    0.00
m3.medium	      1		 0.00000	    0.00	    0.00
t2.micro	      1		 0.00000	    0.00	    0.00
t1.micro	      2		 0.00000	    0.00	    0.00
t2.large	      1		 0.00000	    0.00	    0.00
		-------				-------		---------
Grand Total	     24				    0.00	    0.00

@deinspanjer
Copy link
Contributor Author

deinspanjer commented Aug 4, 2017

Any thoughts about switching to the official price list API? ( http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html )
It is a lot more verbose, but it seems like the kind of thing that could be stored in the RDF and used in several places such as awless list instances.

@simcap
Copy link
Contributor

simcap commented Aug 7, 2017

Are you saying the current API for pricing ec2-price.com is sometimes down or not reliable?

The current pricing API was chosen as a temporary (but accurate) one indeed before getting more into serious pricing: infrastructure pricing, templates pricing, etc ...

The idea is indeed, as you say, to have the official AWS pricing data fetch dynamically and cached locally for more diverse uses.

@simcap
Copy link
Contributor

simcap commented Aug 7, 2017

As per your PR I am not clear on what you are trying to achieve for a pricing output (although a more complete might be useful indeed).

I can see filtering on the running instances could be useful, but it also a specific use case. We might need to pass params down to the inspector to have more control on the output maybe.

@deinspanjer
Copy link
Contributor Author

deinspanjer commented Aug 8, 2017

Are you saying the current API for pricing ec2-price.com is sometimes down or not reliable?

Yes, most of the time when I try running the pricing inspector, it returns the output I pasted in the comment above.

The current pricing API was chosen as a temporary (but accurate) one indeed before getting more into serious pricing: infrastructure pricing, templates pricing, etc ...
The idea is indeed, as you say, to have the official AWS pricing data fetch dynamically and cached locally for more diverse uses.

That seems like it would be fun. Can't make any promises, but I'd be happy to try helping out here and there.

As per your PR I am not clear on what you are trying to achieve for a pricing output (although a more complete might be useful indeed).

I can see filtering on the running instances could be useful, but it also a specific use case. We might need to pass params down to the inspector to have more control on the output maybe.

So when I run the current pricing inspector and look at the results, it gives a monthly price that is vastly larger than the amount we actually pay. The reason for that is because we have several instances that are spot prices, and many instances that are currently stopped.

I thought the idea of this inspector was to give you a quick and dirty estimate of how much you might expect to pay for the resources you are currently being charged for.

That is why I removed things you wouldn't pay the on-demand fee on (stopped and spot) as well as a per day price.

@simcap
Copy link
Contributor

simcap commented Aug 8, 2017

Ok. Thanks for the clarification.

So is the new pricer (expect the issue of the intermittent ec2-price.com) giving you valid estimates that reconcile with your monthly bill ? Looking at your new columns output it also makes sense in term of reporting.

Do any last corrections if needed. I will run through it, test it locally and will merge it accordingly in the next few days.

Thanks.

@deinspanjer
Copy link
Contributor Author

Yes, it aligns with the line items for EC2 run hours minus EBS charges.
I think there are lots of fun things that could be added, especially with some mechanism for configuration or parameters, but this feels like a good incremental improvement to what is currently there.

@simcap
Copy link
Contributor

simcap commented Aug 14, 2017

I have run it locally. Here a a few remarks.

  • Running column: it would be great if as value to the Running column we would see notation like 3/5 instead of single digit (in this case 3). 3/5 would mean 3 running instances out of 5, therefore adding the info that 2 are stopped.
  • the new headers and text are too verbose (double lines headers, etc ...). Since we output in the terminal we should be as succinct as possible without losing information. We should favor one word long text when possible. For exemple: Grand Total where Grand is superflous; Type instead of Instance Type as we see they are instances; word like Price and Cost can be removed if currency unit is added along the digits (previously '$')
  • currency unit symbol has been removed
  • in my case, the printed output does not align making the report not readable. The mis alignment seems to come from the separators before the Grand Total line (cannot really paste it here with the mis alignment)

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.

2 participants