Example #1
0
        static void Main(string[] line)
        {
            string filePath;
            var commands = CommandLine.Pars(line);
            if (!commands.TryGetValue("filepath", out filePath)) return;
            var logContent = new LogReader(filePath);
            var fileAnalyzer = new FileAnalyzer
            {
                Parameters = commands,
                RecordList = logContent.EventList.ToList()
            };

            //  var grahp = new LibraryCreateGraph(1000, 1000);
                Console.WriteLine(fileAnalyzer.GetResultsAnalyzer());
        }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            var fileAnalyzer = new FileAnalyzer
            {
                RecordList = _logReader.EventList.ToList(),
                Parameters = new Dictionary<string, string>
                {

                    {"startDate", startDate.Text.Length == 0 ? null : startDate.Text},
                    {"endDate", endDate.Text.Length == 0 ? null : endDate.Text}
                }
            };

            if (reportDate.Checked)
            {
               fileAnalyzer.Parameters.Add("report", "AnalyzerByDate");
            }

            if (reportUniqueIp.Checked)
            {
                fileAnalyzer.Parameters.Add("report", "AnalyzerByIp");
            }
            if (reportWeightingCoefficient.Checked)
            {
                fileAnalyzer.Parameters.Add("report", "AnalyzerByWeightCoefficients");
                fileAnalyzer.Parameters.Add("Value", value.Text);

            }
            if (reportSpecifiedNumberOfRows.Checked)
            {
                fileAnalyzer.Parameters.Add("report", "LinesAnalyzer");
                fileAnalyzer.Parameters.Add("startLine", startLine.Text);
                fileAnalyzer.Parameters.Add("numberLine", numberLines.Text);
            }

            if (getSum.Checked)
            {
                fileAnalyzer.Parameters.Add("report", "SumOfWeightingCoefficients");
            }

            richTextBox1.ResetText();
            richTextBox1.AppendText(string.Format("{0}\n",
                fileAnalyzer.GetResultsAnalyzer()));
            fileAnalyzer.Parameters.Clear();
            fileAnalyzer.RecordList.Clear();
        }