Ejemplo n.º 1
0
 public override void GetReportData(out ProfileReportCounterData data)
 {
     data           = new ProfileReportCounterData();
     data.Severity  = MathF.Clamp(this.lastValue / Time.MillisecondsPerFrame, 0.0f, 1.0f);
     data.LastValue = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:F}", this.lastValue);
     if (this.IsSingleValue)
     {
         data.AverageValue = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:F}", this.lastValue);
     }
     else
     {
         if (this.sampleCount > 0)
         {
             data.AverageValue = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:F}", (float)(this.accumValue / (double)this.sampleCount));
             data.MinValue     = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:F}", this.accumMinValue);
             data.MaxValue     = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:F}", this.accumMaxValue);
         }
         data.SampleCount = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", this.sampleCount);
     }
 }
Ejemplo n.º 2
0
 public override void GetReportData(out ProfileReportCounterData data)
 {
     data           = new ProfileReportCounterData();
     data.Severity  = 0.5f;
     data.LastValue = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", this.lastValue);
     if (this.IsSingleValue)
     {
         data.AverageValue = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", this.lastValue);
     }
     else
     {
         if (this.sampleCount > 0)
         {
             data.AverageValue = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", (int)Math.Round((double)this.accumValue / (double)this.sampleCount));
             data.MinValue     = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", this.accumMinValue);
             data.MaxValue     = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", this.accumMaxValue);
         }
         data.SampleCount = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", this.sampleCount);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Gathers ProfileCounter data for generating a profile report.
 /// </summary>
 /// <param name="data"></param>
 /// <param name="options"></param>
 public abstract void GetReportData(out ProfileReportCounterData data);