Esempio n. 1
0
        public static ProfilerMeasurement ProfilerMarkers(params string[] profilerMarkerNames)
        {
            var definitions = new SampleGroupDefinition[profilerMarkerNames.Length];

            for (var i = 0; i < profilerMarkerNames.Length; i++)
            {
                definitions[i] = new SampleGroupDefinition(profilerMarkerNames[i]);
            }

            return(new ProfilerMeasurement(definitions));
        }
Esempio n. 2
0
        public static SampleGroup GetSampleGroup(SampleGroupDefinition definition)
        {
            foreach (var sampleGroup in Active.SampleGroups)
            {
                if (sampleGroup.Definition.Name == definition.Name)
                {
                    return(sampleGroup);
                }
            }

            return(null);
        }
Esempio n. 3
0
        public static void Custom(SampleGroupDefinition sampleGroupDefinition, double value)
        {
            var sampleGroup = PerformanceTest.GetSampleGroup(sampleGroupDefinition);

            if (sampleGroup == null)
            {
                sampleGroup = new SampleGroup(sampleGroupDefinition);
                PerformanceTest.Active.SampleGroups.Add(sampleGroup);
            }

            sampleGroup.Samples.Add(value);
        }
Esempio n. 4
0
        public static SampleGroup GetSampleGroup(SampleGroupDefinition definition)
        {
            if (Active == null)
            {
                throw new PerformanceTestException("Trying to record samples but there is no active performance tests.");
            }
            foreach (var sampleGroup in Active.SampleGroups)
            {
                if (sampleGroup.Definition.Name == definition.Name)
                {
                    return(sampleGroup);
                }
            }

            return(null);
        }
Esempio n. 5
0
 public static void Compare(SampleGroupDefinition group, SampleGroupDefinition group2, float percentage)
 {
     Compare(group.Name, group2.Name, percentage);
 }
Esempio n. 6
0
 public ScopeMeasurement(SampleGroupDefinition sampleGroupDefinition)
 {
     m_TimeSampleGroup = new SampleGroup(sampleGroupDefinition);
     m_StartTicks      = Stopwatch.GetTimestamp();
     PerformanceTest.Disposables.Add(this);
 }
Esempio n. 7
0
 public static ScopeMeasurement Scope(SampleGroupDefinition sampleGroupDefinition)
 {
     return(new ScopeMeasurement(sampleGroupDefinition));
 }
Esempio n. 8
0
 public SampleGroup(SampleGroupDefinition definition)
 {
     Definition = definition;
     Samples    = new List <double>();
 }