Skip to content

A fluent library for exporting graph images from CloudWatch metrics.

License

Notifications You must be signed in to change notification settings

Narochno/Narochno.CloudWatch.Graphs

Repository files navigation

Narochno.CloudWatch.Graphs Build status NuGet

A fluent library for exporting graph images from CloudWatch metrics.

Supported Frameworks

  • netstandard2.0
  • .NET Framework 4.7.1

Example Usage

Example

var provider = new ServiceCollection()
    .AddSingleton<IAmazonCloudWatch>(new AmazonCloudWatchClient(RegionEndpoint.EUWest1))
    .AddCloudWatchGraphs()
    .BuildServiceProvider();

var plotBuilder = provider.GetService<IPlotBuilder>();

var plotModel = await plotBuilder.WithTime(DateTime.UtcNow.AddDays(-12), DateTime.UtcNow)
    .AddMetric("AWS/Logs", "IncomingBytes")
        .WithLabel("Average Incoming Bytes")
        .PlotGraph(GraphType.Line, StatisticType.Average, TimeSpan.FromMinutes(30))
    .WithTitle("CloudWatch Logs Incoming Bytes")
    .Generate();

var svgExporter = new SvgExporter
{
    Width = 750,
    Height = 300
};

using (var output = File.Open("example.svg", FileMode.Create))
{
    svgExporter.Export(plotModel, output);
}

About

A fluent library for exporting graph images from CloudWatch metrics.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages