public override async Task Execute()
        {
            var workItemClient = await WorkItemClientFactory.Create(ProjectCollectionUrl, PatToken);

            var workItemReferences = await workItemClient.QueryWorkItemsAsync(ProjectName, Query);

            var calculator        = new WorkItemDoneDateAggregator(workItemClient, DoneState);
            var workItemDoneDates = await calculator.AggregateAsync(workItemReferences, Since);

            var weeklyThroughput =
                workItemDoneDates
                .GroupBy(t => t.DoneDate.StartOfWeek(DayOfWeek.Monday))
                .OrderByDescending(t => t.Key)
                .Select(g => new { WeekBeginning = g.Key, Throughput = g.Count() });

            OutputRendererFactory.Create(OutputFormat).Render(weeklyThroughput);
        }
Exemplo n.º 2
0
        public override async Task Execute()
        {
            var workItemClient = await WorkItemClientFactory.Create(ProjectCollectionUrl, PatToken);

            var workItemReferences = await workItemClient.QueryWorkItemsAsync(ProjectName, Query);

            var calculator = new WorkItemCycleTimeAggregator(InitialState, ToState, Strict, workItemClient);
            var cycleTimes = await calculator.AggregateAsync(workItemReferences, Since);

            var renderer = OutputRendererFactory.Create(OutputFormat);

            if (Detailed)
            {
                renderer.Render(cycleTimes);
            }
            else
            {
                renderer.Render(cycleTimes.Summarise());
            }
        }
        public override async Task Execute()
        {
            var workItemClient = await WorkItemClientFactory.Create(ProjectCollectionUrl, PatToken);

            var workItemReferences = await workItemClient.QueryWorkItemsAsync(ProjectName, Query);

            var aggregator = new WorkItemStateTransitionAggregator(workItemClient);

            var stateTransitions = await aggregator.AggregateAsync(workItemReferences);

            var renderableStateTransitions = new List <WorkItemStateTransition>();

            foreach (var setOfTransitions in stateTransitions)
            {
                renderableStateTransitions.AddRange(setOfTransitions.Flatten());
            }

            var renderer = OutputRendererFactory.Create(OutputFormat);

            renderer.Render(renderableStateTransitions);
        }