Ejemplo n.º 1
0
        public static int ExportLogToTwdb(List <string> files, Disaggregator disaggregator)
        {
            var twdbAdapter     = CreateAnalysisAdapter("dummy.twdb") as ArffAnalysisAdapter;
            var factory         = new LogAdapterFactory();
            int countFilesSaved = 0;

            foreach (var file in files)
            {
                var logAdapter = factory.GetAdapter(file) as LogAdapter;
                if (logAdapter != null)
                {
                    var log = logAdapter.Load(file);

                    var classifier = new NullClassifier();

                    disaggregator.Log = log;
                    Events events = disaggregator.Disaggregate();

                    var analysis = new AnalysisDatabase(file, events, log);
                    classifier.Classify(analysis);

                    analysis.UpdateFixtureSummaries();

                    twdbAdapter.Save(System.IO.Path.ChangeExtension(file, TwEnvironment.ArffAnalysisExtension), analysis, true);
                    countFilesSaved++;
                }
            }
            return(countFilesSaved);
        }
Ejemplo n.º 2
0
        AnalysisPanel LoadLogAndClassify(string fileName, bool showAnalyzer)
        {
            var classifier    = new NullClassifier();
            var disaggregator = new Tw4PostTrickleMergeMidnightSplitDisaggregator();

            Mouse.OverrideCursor = Cursors.Wait;

            Log log = TwServices.CreateLog(fileName);

            disaggregator.Log = log;
            Events events = disaggregator.Disaggregate();

            events.UpdateLinkedList();

            var analysis = new AnalysisDatabase(fileName, events, log);

            classifier.Classify(analysis);

            analysis.UpdateFixtureSummaries();

            var analysisPanel = CreateAnalysisPanel(analysis, fileName, disaggregator, showAnalyzer, GetViewportSeconds(), EventsViewer.VolumeTen);

            Mouse.OverrideCursor = null;
            return(analysisPanel);
        }