Ejemplo n.º 1
0
        private CustomMonitorList()
        {
            CustomMonitorConfig cpuConfig = new CustomMonitorConfig(new CPU());

            cpuConfig.SourceMetricName = CounterNames.ProcessorTotalTime;
            _monitorNameConfigMap.Add(cpuConfig.Name, cpuConfig);

            CustomMonitorConfig availableMemoryConfig = new CustomMonitorConfig(new AvailableMemory());

            availableMemoryConfig.SourceMetricName = CounterNames.MemoryAvailableBytes;
            _monitorNameConfigMap.Add(availableMemoryConfig.Name, availableMemoryConfig);

            CustomMonitorConfig storageAccountTotalRequestsConfig = new CustomMonitorConfig(new TableTotalRequests(Resources.DefaultStorageAccountName));

            storageAccountTotalRequestsConfig.SourceMetricName = MetricNames.TotalRequests;
            _monitorNameConfigMap.Add(storageAccountTotalRequestsConfig.Name, storageAccountTotalRequestsConfig);

            CustomMonitorConfig storageAccountTotalBillableRequestsConfig = new CustomMonitorConfig(new TableTotalBillableRequests(Resources.DefaultStorageAccountName));

            storageAccountTotalBillableRequestsConfig.SourceMetricName = MetricNames.TotalBillableRequests;
            _monitorNameConfigMap.Add(storageAccountTotalBillableRequestsConfig.Name, storageAccountTotalBillableRequestsConfig);

            CustomMonitorConfig storageAccountTableAvailabilityConfig = new CustomMonitorConfig(new TableAvailability(Resources.DefaultStorageAccountName));

            storageAccountTableAvailabilityConfig.SourceMetricName = MetricNames.Availability;
            _monitorNameConfigMap.Add(storageAccountTableAvailabilityConfig.Name, storageAccountTableAvailabilityConfig);
        }
        private CustomMonitorList()
        {
            CustomMonitorConfig cpuConfig = new CustomMonitorConfig(new CPU());
            cpuConfig.SourceMetricName = CounterNames.ProcessorTotalTime;
            _monitorNameConfigMap.Add(cpuConfig.Name, cpuConfig);

            CustomMonitorConfig availableMemoryConfig = new CustomMonitorConfig(new AvailableMemory());
            availableMemoryConfig.SourceMetricName = CounterNames.MemoryAvailableBytes;
            _monitorNameConfigMap.Add(availableMemoryConfig.Name, availableMemoryConfig);

            CustomMonitorConfig storageAccountTotalRequestsConfig = new CustomMonitorConfig(new TableTotalRequests(Resources.DefaultStorageAccountName));
            storageAccountTotalRequestsConfig.SourceMetricName = MetricNames.TotalRequests;
            _monitorNameConfigMap.Add(storageAccountTotalRequestsConfig.Name, storageAccountTotalRequestsConfig);

            CustomMonitorConfig storageAccountTotalBillableRequestsConfig = new CustomMonitorConfig(new TableTotalBillableRequests(Resources.DefaultStorageAccountName));
            storageAccountTotalBillableRequestsConfig.SourceMetricName = MetricNames.TotalBillableRequests;
            _monitorNameConfigMap.Add(storageAccountTotalBillableRequestsConfig.Name, storageAccountTotalBillableRequestsConfig);

            CustomMonitorConfig storageAccountTableAvailabilityConfig = new CustomMonitorConfig(new TableAvailability(Resources.DefaultStorageAccountName));
            storageAccountTableAvailabilityConfig.SourceMetricName = MetricNames.Availability;
            _monitorNameConfigMap.Add(storageAccountTableAvailabilityConfig.Name, storageAccountTableAvailabilityConfig);
        }
 /// <summary>
 /// Convert value to parameter which understand monitis.com 
 /// </summary>
 /// <param name="value">Value to convert</param>
 /// <param name="timeStamp">Parameter timestamp</param>
 /// <param name="config">Configuration of monitor for convert details</param>
 /// <returns></returns>
 public static ResultParameter ConvertToMonitorResult(Double value, DateTime timeStamp,
                                                      CustomMonitorConfig config)
 {
     return ConvertToMonitorResult(value, timeStamp, config.Descriptor.Converter,
                                   config.Descriptor.ResultParams.First().Name);
 }