Beispiel #1
0
        public TestCacheStatSummary GetSummary(DateTimeOffset?startDate)
        {
            var startDateValue = startDate ?? AzureUtil.DefaultStartDate;
            var endDateValue   = DateTimeOffset.UtcNow.Date;

            var stats         = new TestQueryStats();
            var unitTestQuery = _unitTestCounterUtil.Query(startDateValue, endDateValue);

            foreach (var cur in unitTestQuery)
            {
                stats.AssemblyCount  += cur.AssemblyCount;
                stats.TestsPassed    += cur.TestsPassed;
                stats.TestsSkipped   += cur.TestsSkipped;
                stats.TestsFailed    += cur.TestsFailed;
                stats.ElapsedSeconds += cur.ElapsedSeconds;
            }

            var missCount   = 0;
            var uploadCount = 0;
            var cacheQuery  = _testCacheCounterUtil.Query(startDateValue, endDateValue);

            foreach (var cur in cacheQuery)
            {
                missCount   += cur.MissCount;
                uploadCount += cur.StoreCount;
            }

            var testRunCount = 0;
            var testRunQuery = _testRunCounterUtil.Query(startDateValue, endDateValue);

            foreach (var cur in testRunQuery)
            {
                testRunCount += cur.RunCount;
            }

            return(new TestCacheStatSummary(
                       hitStats: stats,
                       missCount: missCount,
                       uploadCount: uploadCount,
                       testResultCount: _testResultStorage.GetCount(startDate),
                       testRunCount: testRunCount));
        }
Beispiel #2
0
        public TestCacheStatSummary GetSummary(DateTimeOffset? startDate)
        {
            var startDateValue = startDate ?? AzureUtil.DefaultStartDate;
            var endDateValue = DateTimeOffset.UtcNow.Date;

            var stats = new TestQueryStats();
            var unitTestQuery = _unitTestCounterUtil.Query(startDateValue, endDateValue);
            foreach (var cur in unitTestQuery)
            {
                stats.AssemblyCount += cur.AssemblyCount;
                stats.TestsPassed += cur.TestsPassed;
                stats.TestsSkipped += cur.TestsSkipped;
                stats.TestsFailed += cur.TestsFailed;
                stats.ElapsedSeconds += cur.ElapsedSeconds;
            }

            var missCount = 0;
            var uploadCount = 0;
            var cacheQuery = _testCacheCounterUtil.Query(startDateValue, endDateValue);
            foreach (var cur in cacheQuery)
            {
                missCount += cur.MissCount;
                uploadCount += cur.StoreCount;
            }

            var testRunCount = 0;
            var testRunQuery = _testRunCounterUtil.Query(startDateValue, endDateValue);
            foreach (var cur in testRunQuery)
            {
                testRunCount += cur.RunCount;
            }

            return new TestCacheStatSummary(
                hitStats: stats,
                missCount: missCount,
                uploadCount: uploadCount,
                testResultCount: _testResultStorage.GetCount(startDate),
                testRunCount: testRunCount);
        }