Ejemplo n.º 1
0
        protected CounterEntity(CounterData data)
        {
            var key = CounterUtil.GetEntityKey(data);

            PartitionKey     = key.PartitionKey;
            RowKey           = key.RowKey;
            IsJenkins        = data.IsJenkins;
            DateTimeUtcTicks = data.DateTime.UtcTicks;
            EntityWriterId   = data.EntityWriterId;
        }
Ejemplo n.º 2
0
        public TestCacheStatSummary GetSummary(DateTimeOffset?startDate)
        {
            var startDateValue = startDate ?? AzureUtil.DefaultStartDate;
            var endDateValue   = DateTimeOffset.UtcNow;

            var stats         = new TestQueryStats();
            var unitTestQuery = CounterUtil.Query <UnitTestCounterEntity>(_unitTestCounterTable, 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  = CounterUtil.Query <TestCacheCounterEntity>(_testCacheCounterTable, startDateValue, endDateValue);

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

            var testRunCount = 0;
            var testRunQuery = CounterUtil.Query <TestRunCounterEntity>(_testRunCounterTable, 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));
        }
Ejemplo n.º 3
0
 public override string ToString() => CounterUtil.GetEntityKey(this).ToString();