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;
}
}
}