コード例 #1
0
        static void Main(string[] args)
        {
            var pathToFolderWithMetrics = args[0];
            var pathToTestedRepository  = args[1];

            var volumeMetricsProvider = new VolumeMetricsProvider(pathToFolderWithMetrics);
            var allFilesData          = volumeMetricsProvider.ProvideVolumeMetrics();

            var gitConnector             = new GitProvider(pathToTestedRepository);
            var volumeMetricsWithCommits = gitConnector.AddCommitsMetrics(allFilesData);

            var basicMetricsProvider = new BasicMetricsProvider(pathToFolderWithMetrics);
            var basicMetrics         = basicMetricsProvider.ProvideBasicMetrics();

            var metricsAggregator = new MetricsAggregator();
            var aggregatedMetrics = metricsAggregator.AggregateMetrics(basicMetrics, volumeMetricsWithCommits);

            var additionalInformationCreator = new AdditionalInformationCreator();

            additionalInformationCreator.SaveToFileLimitValues(aggregatedMetrics);
            additionalInformationCreator.SaveToFileAsJson(aggregatedMetrics);

            var treeStructureConverter   = new TreeStructureConverter();
            var treeStructureMetrics     = treeStructureConverter.GenerateTreeStructureFromPaths(aggregatedMetrics);
            var jsonTreeStructureMetrics = JsonConvert.SerializeObject(treeStructureMetrics);

            File.WriteAllText(Directory.GetCurrentDirectory() + "\\OutputsFiles\\FinalStatisticsOutput.json", jsonTreeStructureMetrics);
        }
コード例 #2
0
 public MetricCollectionServiceShould()
 {
     this.fakeMonitoringResource = A.Fake <IMonitoringApiClient>();
     this.fakeMetricsAggregator  = A.Fake <MetricsAggregator>();
     this._fakeMetricsRequest    = BuildMetricRequest();
     this.sut = new MetricCollectionService(this.fakeMonitoringResource, this.fakeMetricsAggregator);
 }
コード例 #3
0
        public ISession CreateSession(Action <ISession> initializationAction)
        {
            var agenda            = CreateAgenda();
            var workingMemory     = new WorkingMemory();
            var eventAggregator   = new EventAggregator(_eventAggregator);
            var metricsAggregator = new MetricsAggregator();
            var actionExecutor    = new ActionExecutor();
            var idGenerator       = new IdGenerator();
            var session           = new Session(_network, agenda, workingMemory, eventAggregator, metricsAggregator, actionExecutor, idGenerator, DependencyResolver, ActionInterceptor);

            initializationAction?.Invoke(session);
            session.Activate();
            return(session);
        }