Home » cloud4net

estimate your AWS/Azure bill with cloud4net

24. December 2009 by Julien Brunet 10 Comments

The 1.0 Beta 2 of cloud4net released today includes code to collect made to AWS/Azure, and to compute the related price.

If you already have AWS / Azure code, you do not need to rewrite it to us the cloud4net model - the data collection is made independently on the sockets stack.

How-to:

using System.StorageModel.Diagnostics;

public class MyCloudStories
{
  public void Story1()
  {
    WebRequestMonitor.Enable();
    BandwithMonitor.Enable();

    using (var log = new WebRequestLog())
    {
      // do some Azure or AWS requests. You can even combine them
      // ...

      // retrieve captured records, and extrapolate to a million time + 10000
      var records = log.GetAllRecords().Repeat(1.Million()+10.Kilo(), true);

      // get the "bill" for the azure calls
      var azureProvider  = Storage.GetProvider("Azure");
      var azureBill = azureProvider.ComputeBilling(records);
      var azurePrice = azureBill.Price;

      // get the "bill" for the AWS calls
      var awsProvider  = Storage.GetProvider("AWS");
      var awsBill = awsProvider.ComputeBilling(records);
      var awsPrice = awsBill.Price;
    
    }
  }
}

Comments

love calculator
United States love calculator said:

Hi, I was browsing the web  and I ran into your blog. Keep up the excellent work.

Fatcow Coupon
United States Fatcow Coupon said:

Should I get a VPS? At the moment I am using godaddy but they keep disabling my account because of high server load. Im getting about 4,000 UV a day. What hosting should I get?

howto cure genital warts
Republic of the Philippines howto cure genital warts said:

This condition, which can occur in the same places as genital warts is actually simply a variation on anatomy and though they can be removed for aesthetic purposes, do not cause any harm at all.

wow mobile
United States wow mobile said:

WoW Mobiles is awesome! I get free mobile service with t-mobile because I refered 3 people to wow. You can too!

free hd movies
United States free hd movies said:

I like streaming movies online, it is way cheaper than going to the theaters.

hd movies
United States hd movies said:

I enjoy streaming movies online, it is way cheaper than going to the theaters.

watch movies online free
United States watch movies online free said:

I enjoy watching movies online, it is way cheaper than going to the theaters.

WoW Mobile
United States WoW Mobile said:

Is tethering against the Terms of Service of cell phone companies? Which ones allow it?

May Breines
United States May Breines said:

Hiya, nice day.. Your article is extremely impressive. I never considered that it was feasible to accomplish something like that until after I looked over your post. You certainly gave a great perception on exactly how this whole process works. I will make sure to return for more advice. Thanks

Ruth McDevitt
United States Ruth McDevitt said:

What did the silly boy take his bicycle to bed with him? Because he didnt want to walk in his sleep.

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading