/// <inheritdoc/>
        public void WriteDataSet(IProfilingDataSet dataSet)
        {
            if (dataSet == null)
            {
                throw new ArgumentNullException("dataSet");
            }

            List <CallTreeNode> list = new List <CallTreeNode>();

            FindUnitTests(dataSet.RootNode, list);

            if (list.Count > 0)
            {
                targetWriter.WriteDataSet(
                    new UnitTestDataSet(new UnitTestRootCallTreeNode(list), dataSet.IsFirst)
                    );
            }
            else
            {
                // proposed fix for http://community.sharpdevelop.net/forums/t/10533.aspx
                // discuss with Daniel
                targetWriter.WriteDataSet(dataSet);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Copies all data to a different writer.
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="progressReport">Used to report the progress of writing all DataSets, returning false tells WriteTo to cancel the process.</param>
        public void WriteTo(IProfilingDataWriter writer, Predicate <double> progressReport)
        {
            writer.ProcessorFrequency = this.processorFrequency;
            writer.WriteMappings(this.nameMappings.Values);
            for (int i = 0; i < this.DataSetCount; i++)
            {
                using (UnmanagedProfilingDataSet dataSet = this.LoadDataSet(i))
                    writer.WriteDataSet(dataSet);

                if (!progressReport.Invoke((i + 1) / (double)this.DataSetCount))
                {
                    break;
                }
            }
        }
        /// <summary>
        /// Copies all data to a different writer.
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="progressReport">Used to report the progress of writing all DataSets, returning false tells WriteTo to cancel the process.</param>
        public void WriteTo(IProfilingDataWriter writer, Predicate <double> progressReport)
        {
            writer.ProcessorFrequency = processorFrequency;
            writer.WriteMappings(nameMappings.Values);
            writer.WritePerformanceCounterData(counters);
            writer.WriteEventData(events);

            for (int i = 0; i < DataSetCount; i++)
            {
                using (UnmanagedProfilingDataSet dataSet = LoadDataSet(i))
                    writer.WriteDataSet(dataSet);

                if (!progressReport.Invoke((i + 1) / (double)DataSetCount))
                {
                    break;
                }
            }
        }
Ejemplo n.º 4
0
		/// <summary>
		/// Copies all data to a different writer.
		/// </summary>
		/// <param name="writer"></param>
		/// <param name="progressReport">Used to report the progress of writing all DataSets, returning false tells WriteTo to cancel the process.</param>
		public void WriteTo(IProfilingDataWriter writer, Predicate<double> progressReport)
		{
			writer.ProcessorFrequency = this.processorFrequency;
			writer.WriteMappings(this.nameMappings.Values);
			for (int i = 0; i < this.DataSetCount; i++) {
				using (UnmanagedProfilingDataSet dataSet = this.LoadDataSet(i))
					writer.WriteDataSet(dataSet);
				
				if (!progressReport.Invoke((i + 1) / (double)this.DataSetCount))
					break;
			}
		}
Ejemplo n.º 5
0
		/// <summary>
		/// Copies all data to a different writer.
		/// </summary>
		/// <param name="writer"></param>
		/// <param name="progressReport">Used to report the progress of writing all DataSets, returning false tells WriteTo to cancel the process.</param>
		public void WriteTo(IProfilingDataWriter writer, Predicate<double> progressReport)
		{
			writer.ProcessorFrequency = processorFrequency;
			writer.WriteMappings(nameMappings.Values);
			writer.WritePerformanceCounterData(counters);
			writer.WriteEventData(events);
			
			for (int i = 0; i < DataSetCount; i++) {
				using (UnmanagedProfilingDataSet dataSet = LoadDataSet(i))
					writer.WriteDataSet(dataSet);
				
				if (!progressReport.Invoke((i + 1) / (double)DataSetCount))
					break;
			}
		}