コード例 #1
0
    private void PrintMachineResultAnalysis(MachineTestMachineResult machineResult)
    {
        string machineDir = Path.Combine(_outputDir, machineResult.MachineName) + "/";

        Directory.CreateDirectory(machineDir);

        for (int i = 0; i < machineResult.UserResults.Count; i++)
        {
            MachineTestUserResult userResult = machineResult.UserResults[i];

            MachineTestUserResultPrinter userPrinter = new MachineTestUserResultPrinter(userResult);
            userPrinter.WriteResult(machineDir, MachineTestPrintFileNameMode.UserId);

            MachineTestAnalysisResult singleAnalysisResult = MachineTestAnalysisHelper.Instance.AnalyzeSingleUser(userResult);
            userResult.AnalysisResult = singleAnalysisResult;

            MachineTestAnalysisResultPrinter singleAnalysisPrinter = new MachineTestAnalysisResultPrinter(_config, userResult, singleAnalysisResult);
            singleAnalysisPrinter.WriteResult(machineDir);
        }

        MachineTestAnalysisResult analysisResult = MachineTestAnalysisHelper.Instance.AnalyzeSingleMachine(machineResult, _config._userCount);

        machineResult.AnalysisResult = analysisResult;

        MachineTestAnalysisResultPrinter analysisPrinter = new MachineTestAnalysisResultPrinter(_config, machineResult, analysisResult);

        analysisPrinter.WriteResult(machineDir);
    }
コード例 #2
0
    void OutputPrintMachineResult(MachineTestMachineResult machineResult, MachineSeedGenConfig genConfig)
    {
        if (genConfig._isOutputUserResult)
        {
            string machineDir = Path.Combine(_outputUserResultDir, machineResult.MachineName) + "/";
            if (Directory.Exists(machineDir))
            {
                DirectoryInfo info = new DirectoryInfo(machineDir);
                foreach (FileInfo file in info.GetFiles())
                {
                    file.Delete();
                }
            }

            Directory.CreateDirectory(machineDir);

            for (int i = 0; i < machineResult.UserResults.Count; i++)
            {
                MachineTestUserResult userResult = machineResult.UserResults[i];

                MachineTestUserResultPrinter userPrinter = new MachineTestUserResultPrinter(userResult);
                userPrinter.WriteResult(machineDir, MachineTestPrintFileNameMode.Seed);
            }
        }
    }