protected BenchmarkEnvironmentInfo()
 {
     Architecture   = RuntimeInformation.GetArchitecture();
     ClrVersion     = RuntimeInformation.GetClrVersion();
     Configuration  = RuntimeInformation.GetConfiguration();
     HasRyuJit      = RuntimeInformation.HasRyuJit();
     IsServerGC     = GCSettings.IsServerGC;
     IsConcurrentGC = GCSettings.LatencyMode != GCLatencyMode.Batch;
 }
예제 #2
0
 protected BenchmarkEnvironmentInfo()
 {
     Architecture        = RuntimeInformation.GetArchitecture();
     RuntimeVersion      = RuntimeInformation.GetRuntimeVersion();
     Configuration       = RuntimeInformation.GetConfiguration();
     HasRyuJit           = RuntimeInformation.HasRyuJit();
     JitInfo             = RuntimeInformation.GetJitInfo();
     IsServerGC          = GCSettings.IsServerGC;
     IsConcurrentGC      = GCSettings.LatencyMode != GCLatencyMode.Batch;
     HasAttachedDebugger = Debugger.IsAttached;
 }
예제 #3
0
 protected BenchmarkEnvironmentInfo()
 {
     Architecture        = RuntimeInformation.GetArchitecture();
     RuntimeVersion      = RuntimeInformation.GetRuntimeVersion();
     Configuration       = RuntimeInformation.GetConfiguration();
     HasRyuJit           = RuntimeInformation.HasRyuJit();
     JitInfo             = RuntimeInformation.GetJitInfo();
     IsServerGC          = GCSettings.IsServerGC;
     IsConcurrentGC      = GCSettings.LatencyMode != GCLatencyMode.Batch;
     HasAttachedDebugger = Debugger.IsAttached;
     GCAllocationQuantum = GcStats.AllocationQuantum;
     InDocker            = RuntimeInformation.IsRunningInContainer;
 }
예제 #4
0
 private EnvironmentInfo()
 {
     BenchmarkDotNetCaption = GetBenchmarkDotNetCaption();
     BenchmarkDotNetVersion = GetBenchmarkDotNetVersion();
     OsVersion            = RuntimeInformation.GetOsVersion();
     ProcessorName        = RuntimeInformation.GetProcessorName();
     ProcessorCount       = Environment.ProcessorCount;
     ClrVersion           = RuntimeInformation.GetClrVersion();
     Architecture         = GetArchitecture();
     HasAttachedDebugger  = Debugger.IsAttached;
     HasRyuJit            = RuntimeInformation.HasRyuJit();
     Configuration        = RuntimeInformation.GetConfiguration();
     ChronometerFrequency = Chronometer.Frequency;
     JitModules           = RuntimeInformation.GetJitModules();
     HardwareTimerKind    = Chronometer.HardwareTimerKind;
     DotNetCliVersion     = new Lazy <string>(DotNetCliCommandExecutor.GetDotNetCliVersion);
 }
예제 #5
0
            public void Benchmark()
            {
                if (Assembly.GetEntryAssembly().IsJitOptimizationDisabled().IsTrue())
                {
                    throw new InvalidOperationException("Auto-generated project has not enabled optimizations!");
                }
                if (typeof(CustomBuildConfiguration).Assembly.IsJitOptimizationDisabled().IsTrue())
                {
                    throw new InvalidOperationException("Project that defines benchmarks has not enabled optimizations!");
                }
                if (RuntimeInformation.GetConfiguration() == RuntimeInformation.DebugConfigurationName)
                {
                    throw new InvalidOperationException($"Configuration rezognized as {RuntimeInformation.DebugConfigurationName}!");
                }

#if !CUSTOM
                throw new InvalidOperationException("Should never happen");
#endif
            }