public void WritePerformanceMeasurements(PerformanceMeasurements measurements, PerformanceMeasurementConfigurationParameters configuration)
 {
     ValidateArguments(measurements, configuration);
     using (TextWriter textWriter = GetTextWriterForDestination(configuration))
     {
         SerializeMeasurementsToStream(measurements, textWriter);
     }
 }
Example #2
0
 protected override void SerializeMeasurementsToStream(PerformanceMeasurements measurements, TextWriter textWriter)
 {
     SerializeHeaderToStream(measurements, textWriter);
     SerializeHistogramToStream(measurements.RealizationTimes, textWriter);
     SerializeHistogramsToStream(measurements.SolverSteps, textWriter);
     SerializeHistogramsToStream(measurements.StepTicks, textWriter);
     SerializeHistogramsToStream(measurements.ReactionFirings, textWriter);
 }
 protected static void ValidateArguments(PerformanceMeasurements measurements,
                                         PerformanceMeasurementConfigurationParameters configuration)
 {
     if (measurements == null)
     {
         throw new ArgumentNullException("measurements");
     }
     if (configuration == null)
     {
         throw new ArgumentNullException("configuration");
     }
 }
Example #4
0
        protected override void SerializeMeasurementsToStream(PerformanceMeasurements measurements, TextWriter textWriter)
        {
            var jsonSerializer = new JsonSerializer();

            jsonSerializer.Converters.Add(new HistogramConverter());

            using (var jsonWriter = new JsonTextWriter(textWriter))
            {
                SetJsonWriterParameters(jsonWriter);
                jsonSerializer.Serialize(jsonWriter, measurements);
            }
        }
Example #5
0
 private static void SerializeHeaderToStream(PerformanceMeasurements measurements, TextWriter textWriter)
 {
     textWriter.WriteLine("FormatVersion,\"{0}\"", measurements.FormatVersion);
     textWriter.WriteLine("FrameworkVersion,\"{0}\"", measurements.FrameworkVersion);
     textWriter.WriteLine("FrameworkDescription,\"{0}\"", measurements.FrameworkDescription);
     textWriter.WriteLine("SimulationDuration,{0}", measurements.SimulationDuration);
     textWriter.WriteLine("LogCount,{0}", measurements.FrameCount);
     textWriter.WriteLine("HistogramBins,{0}", measurements.HistogramBins);
     textWriter.WriteLine("TotalTimeTicks,{0}", measurements.TotalTimeTicks);
     textWriter.WriteLine("TickFrequency,{0}", measurements.TickFrequency);
     textWriter.WriteLine("TotalTimeMs,{0}", measurements.TotalTimeMs);
     textWriter.WriteLine("MeasurementTimeTicks,{0}", measurements.MeasurementTimeTicks);
 }
 protected abstract void SerializeMeasurementsToStream(PerformanceMeasurements measurements, TextWriter textWriter);