Пример #1
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "jPerf Capture|*.jpc|JSON File|*.json";
            openFileDialog.Title  = "Open jPerf Capture File";
            openFileDialog.ShowDialog();

            if (openFileDialog.FileName != "")
            {
                string     textData;
                FileStream stream = new FileStream(openFileDialog.FileName, FileMode.Open, FileAccess.Read);
                using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
                {
                    textData = reader.ReadToEnd();
                }

                this.profiler      = Profiler.FromJson(textData, log);
                this.profiler.name = openFileDialog.FileName;
                UpdateView(true);
                sampleChart.Zoom(0, profiler.GetRecordingLength() / SampleChart.TimeUnitDivisor(timeUnit));
            }
        }
Пример #2
0
 private void minutesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     timeUnit = TimeUnit.Minutes;
     UpdateView(true);
     sampleChart.Zoom(0, profiler.GetRecordingLength() / SampleChart.TimeUnitDivisor(timeUnit));
 }
Пример #3
0
 private void resetViewToolStripMenuItem_Click(object sender, EventArgs e)
 {
     sampleChart.Zoom(0, profiler.GetRecordingLength() / SampleChart.TimeUnitDivisor(timeUnit));
 }
Пример #4
0
 private void stopRecordingToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.profiler.StopRecording();
     UpdateView(true);
     sampleChart.Zoom(0, (int)Math.Floor(this.profiler.Stopwatch.Elapsed.TotalMilliseconds / SampleChart.TimeUnitDivisor(timeUnit)));
 }