Esempio n. 1
0
        internal SeriesSummary GetSummary()
        {
            if (Init() == false)
            {
                return(null);
            }

            InitializeSegment(out _, out _currentSegment);

            var result = new SeriesSummary(_currentSegment.NumberOfValues);

            do
            {
                if (_currentSegment.NumberOfEntries == 0)
                {
                    continue;
                }

                for (int i = 0; i < _currentSegment.NumberOfValues; i++)
                {
                    if (result.Count == 0)
                    {
                        result.Min[i] = _currentSegment.SegmentValues.Span[i].Min;
                        result.Max[i] = _currentSegment.SegmentValues.Span[i].Max;
                        continue;
                    }

                    if (double.IsNaN(_currentSegment.SegmentValues.Span[i].Min) == false)
                    {
                        result.Min[i] = Math.Min(result.Min[i], _currentSegment.SegmentValues.Span[i].Min);
                    }

                    if (double.IsNaN(_currentSegment.SegmentValues.Span[i].Max) == false)
                    {
                        result.Max[i] = Math.Max(result.Max[i], _currentSegment.SegmentValues.Span[i].Max);
                    }
                }

                result.Count += _currentSegment.NumberOfLiveEntries;
            } while (NextSegment(out _));

            return(result);
        }
Esempio n. 2
0
 public static int GetSeriesId(this SeriesSummary series)
 {
     return(int.Parse(series.ResourceURI.Substring(series.ResourceURI.LastIndexOf('/') + 1)));
 }