Пример #1
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);
		}
Пример #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);

		}
Пример #4
0
 public CloudServiceUsage(CloudServiceInstanceId instanceId, AzureCloudServiceMetricsApiClient azureMetricsApiClient, MetricsFilter filter)
 {
     _azureMetricsApiClient = azureMetricsApiClient;
     _instanceId            = instanceId;
     _filter = filter;
 }
Пример #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);
		}
Пример #7
0
		public CloudServiceUsage(CloudServiceInstanceId instanceId,AzureCloudServiceMetricsApiClient azureMetricsApiClient, MetricsFilter filter) {
			_azureMetricsApiClient = azureMetricsApiClient;
			_instanceId = instanceId;
            _filter = filter;
		}
Пример #8
0
 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));
 }
Пример #10
0
 internal async System.Threading.Tasks.Task <ICollection <MetricValueSet> > GetMetricsForCloudService(CloudServiceInstanceId instance, TimeSpan history, MetricsFilter filter)
 {
     return(await GetMetricsForResourceId(instance.ResourceId, history, filter));
 }