Пример #1
0
 private IEnumerable <IMetricObject> GetMetricObjectsByFilter(MetricRequest filter)
 {
     if (filter.Groups.Length == 0 && filter.Instances.Length == 0)
     {
         return(_metrics.Keys
                .Where(m => _sourceCache.IsDefaultInstance(m.Dto.InstanceID)));
     }
     else
     {
         return(_metrics.Keys
                .Where(m =>
                       filter.Groups.Any(gr => _sourceCache.IsInstanceInGroup(m.Dto.InstanceID, gr)) ||
                       filter.Instances.Contains(m.Dto.InstanceID)));
     }
 }
Пример #2
0
 public MeasureResponse[] GetCurrentMeasures(MetricRequest filter)
 {
     return(GetMetricObjectsByFilter(filter)
            .Select(m => m.GetCurrentMeasure())
            .ToArray());
 }
Пример #3
0
 public WindowResponse[] GetWindowMeasures(MetricRequest filter)
 {
     return(GetMetricObjectsByFilter(filter)
            .Select(m => m.GetWindow())
            .ToArray());
 }