private static void AddUsageObjectIfAvailable(CloudServiceInstanceId instance,MetricValueSet metric,MetricValue value,double? metricValue,string valueName, List<UsageObject> usageObjects) {
			if(metricValue == null) {
				return;
			}
			var usageObject = new UsageObject {
				GraphiteCounterName = instance.BuildGraphiteCounterName(metric.Name,metric.Unit,valueName).ToString(),
				Timestamp = value.Timestamp.ToString("o"),
				Value = metricValue.Value
			};
			usageObjects.Add(usageObject);
		}
Beispiel #2
0
        private static void AddUsageObjectIfAvailable(CloudServiceInstanceId instance, MetricValueSet metric, MetricValue value, double?metricValue, string valueName, List <UsageObject> usageObjects)
        {
            if (metricValue == null)
            {
                return;
            }
            var usageObject = new UsageObject {
                GraphiteCounterName = instance.BuildGraphiteCounterName(metric.Name, metric.Unit, valueName).ToString(),
                Timestamp           = value.Timestamp.ToString("o"),
                Value = metricValue.Value
            };

            usageObjects.Add(usageObject);
        }
		public async Task<ICollection<MetricValueSet>> GetMetricsForInstance(CloudServiceInstanceId instance, TimeSpan history, MetricsFilter filter) {
			//var resourceId=ResourceIdBuilder.BuildCloudServiceResourceId(instance.ServiceName,instance.DeploymentName,instance.RoleName,instance.InstanceName);
			return await _azureMetricsApiClient.GetMetricsForCloudService(instance, history,filter);

		}
Beispiel #4
0
 public CloudServiceUsage(CloudServiceInstanceId instanceId, AzureCloudServiceMetricsApiClient azureMetricsApiClient, MetricsFilter filter)
 {
     _azureMetricsApiClient = azureMetricsApiClient;
     _instanceId            = instanceId;
     _filter = filter;
 }
Beispiel #5
0
 public CloudServiceUsage(CloudServiceInstanceId instanceId, AzureCloudServiceMetricsApiClient azureMetricsApiClient)  : this(instanceId, azureMetricsApiClient, MetricsFilter.None)
 {
 }
		internal async System.Threading.Tasks.Task<ICollection<MetricValueSet>> GetMetricsForCloudService(CloudServiceInstanceId instance,TimeSpan history, MetricsFilter filter) {
			return await GetMetricsForResourceId(instance.ResourceId,history, filter);
		}
		public CloudServiceUsage(CloudServiceInstanceId instanceId,AzureCloudServiceMetricsApiClient azureMetricsApiClient, MetricsFilter filter) {
			_azureMetricsApiClient = azureMetricsApiClient;
			_instanceId = instanceId;
            _filter = filter;
		}
 public CloudServiceUsage(CloudServiceInstanceId instanceId,AzureCloudServiceMetricsApiClient azureMetricsApiClient)  : this(instanceId,azureMetricsApiClient,MetricsFilter.None) {
 }
 public async Task <ICollection <MetricValueSet> > GetMetricsForInstance(CloudServiceInstanceId instance, TimeSpan history, MetricsFilter filter)
 {
     //var resourceId=ResourceIdBuilder.BuildCloudServiceResourceId(instance.ServiceName,instance.DeploymentName,instance.RoleName,instance.InstanceName);
     return(await _azureMetricsApiClient.GetMetricsForCloudService(instance, history, filter));
 }
 internal async System.Threading.Tasks.Task <ICollection <MetricValueSet> > GetMetricsForCloudService(CloudServiceInstanceId instance, TimeSpan history, MetricsFilter filter)
 {
     return(await GetMetricsForResourceId(instance.ResourceId, history, filter));
 }