Пример #1
0
        static async Task MainMT(string[] args)
        {
            var authProvider = new DeviceCodeAuthProvider();

            //graphClient = new GraphServiceClient(authProvider);

            using HttpClient client = new HttpClient(new HttpClientHandler()
            {
                MaxConnectionsPerServer = 1440
            });
            graphClient = new GraphServiceClient(client);
            graphClient.AuthenticationProvider = authProvider;
            await DbOperations.ClearResourcesAsync();

            Console.WriteLine("Clear DB ..");
            Console.WriteLine("Start Watching..");
            perf.StartOn    = DateTime.UtcNow;
            perf.TeamsCount = noTeams;
            //await RunBatchAsync();
            await BatchRequestExample(graphClient, 20);

            //await WatchTeamsAsync(noTeams);
            perf.ActivitiesCalls     = activitiesCalls;
            perf.DeltaCalls          = libraryDeltaCalls;
            perf.Duration            = (int)DateTime.UtcNow.Subtract(perf.StartOn).TotalSeconds;
            perf.CompletedOn         = DateTime.UtcNow;
            perf.AverageSyncDuration = DbOperations.GetAverageSync();
            perf.TotalDuration       = totalDuration;
            perf.NoOfRuns            = noOfRuns;
            perf.AvgDuration         = totalDuration / noOfRuns;
            await DbOperations.UpdatePerformanceAsync(perf);

            Console.WriteLine($"Teams={perf.TeamsCount} - DeltaCalls={perf.DeltaCalls} - ActivitiesCalls={perf.ActivitiesCalls} - AverageSyncDuration={perf.AverageSyncDuration}");
        }
Пример #2
0
        static async Task MainST(string[] args)
        {
            await DbOperations.ClearResourcesAsync();

            Console.WriteLine("Clear DB ..");
            Console.WriteLine("Start Watching..");
            var authProvider = new DeviceCodeAuthProvider();

            graphClient = new GraphServiceClient(authProvider);
            await WatchTeamsAsync();

            endTime = DateTime.UtcNow;
        }