Example #1
0
		public override void GetReportData(out ReportCounterData data, ReportOptions options)
		{
			data = new ReportCounterData();
			data.Severity = MathF.Clamp(this.lastValue / Time.MsPFMult, 0.0f, 1.0f);

			if ((options & ReportOptions.LastValue) != ReportOptions.None)
				data.LastValue = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:F}", this.lastValue);

			if (this.IsSingleValue)
			{
				if ((options & ReportOptions.AverageValue) != ReportOptions.None)
					data.AverageValue = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:F}", this.lastValue);
			}
			else
			{
				if ((options & ReportOptions.AverageValue) != ReportOptions.None)
					data.AverageValue = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:F}", (float)(this.accumValue / (double)this.sampleCount));
				if ((options & ReportOptions.MinValue) != ReportOptions.None)
					data.MinValue = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:F}", this.accumMinValue);
				if ((options & ReportOptions.MaxValue) != ReportOptions.None)
					data.MaxValue = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:F}", this.accumMaxValue);
				if ((options & ReportOptions.SampleCount) != ReportOptions.None)
					data.SampleCount = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", this.sampleCount);
			}
		}
Example #2
0
		/// <summary>
		/// Gathers ProfileCounter data for generating a profile report.
		/// </summary>
		/// <param name="data"></param>
		/// <param name="options"></param>
		public abstract void GetReportData(out ReportCounterData data, ReportOptions options);