Example #1
0
        static void Main(string[] args)
        {
            var service = new CloudWatchService();
            service.Start();

            service.AddMetric(new PerformanceCounterMetric()
            {
                Name = "PagingFilePctUsage",
                Unit = MetricUnit.Percent,
                ReportInterval = TimeSpan.FromSeconds(60),
                PerformanceCounter = new PerformanceCounterDescription()
                {
                    Category = "Paging File",
                    Name = "% Usage",
                    InstanceName = "_Total"
                }
            });

            service.SetAwsCredentials("XXX", "XXXX");

            Console.WriteLine("Press ANY KEY to exit ...");
            Console.ReadKey();

            IManagementService client = ManagementServiceClient.Create();
            foreach (var metric in client.GetMetrics())
            {
                Console.WriteLine(metric.Name);
            }

            service.Stop();
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ManagementService"/> class.
 /// </summary>
 /// <param name="service">The service.</param>
 public ManagementService(CloudWatchService service)
 {
     Service = service;
 }