Comments (6)
If you're open to a platform-specific option, WMI may yield enough info. An example from PowerShell:
Get-WmiObject -Class Win32_Processor | fl
or
Get-WmiObject -Class Win32_Processor | Get-Member
Some of the available data:
- CurrentClockSpeed
- L2CacheSize
- L2CacheSpeed
- L3CacheSize
- L3CacheSpeed
- NumberOfCores
- NumberOfEnabledCore
- NumberOfLogicalProcessors
- Stepping,
etc.
We can get WMI data via Microsoft.Management.Infrastructure, if you're open to that...
from nbench.
@antondelsink I'm open to platform-specific tooling here, although here's the catch: we have to make it switchable underneath so the core NBench library can appear to be platform-agnostic. This is an absolute must-have for supporting .NET Core in the future.
So here's what I propose: we create a provider model for SysInfo
which will lazily load one of three possible SysInfo
concrete implementations:
- The generalized, "safe" default one we have now;
- A Windows-specific WMI provider; and
- A to-be-announced Linux / Posix-specific provider.
Provider 1 is included in the default NBench library, and it's always the fallback in the event that implementations 2 or 3 fail to load or aren't available.
Implementations 2 and 3 will be implemented in external DLLs, so NBench.SysInfo.Windows and NBench.SysInfo.Linux perhaps.
At runtime, we'll detect the OS and Assembly.Load
the appropriate implementation and then that that SysInfo
object as the data provider going forward. If any part of that operation fails, fall back to Provider 1 and continue.
We'll also need to expand the fields on the SysInfo
object to include this additional data too. Maybe it's better to just have a dictionary of properties we can populate rather than a bunch of static fields.
What do you think @antondelsink ?
from nbench.
Assembly.Load would work... also consider a Conditional on the reference to the library NBench.SysInfo.Windows so the decision is made at time of build, perhaps with the default build providing only the "safe" default SysInfo.
from nbench.
I'll put together a naïve NBench.SysInfo.Windows.WMI class in a new project under the same solution, but @Aaronontheweb tell me more about how you would like to load it. Perhaps from the current SysInfo.CreateInstance?
from nbench.
@Aaronontheweb: take a look at #109; I've also added:
- Get-WmiObject -Class Win32_PhysicalMemory
- Get-WmiObject -Class Win32_BIOS
from nbench.
Hi @Aaronontheweb, still interested in this?
from nbench.
Related Issues (20)
- .Net Core: NU1605 Detected package downgrade: System.Reflection.TypeExtensions HOT 4
- Bug: unable to propagate --concurrent setting to .NET Core executables via dotnet nbench
- The specified framework version '2.1' could not be parsed HOT 7
- Ability to have PerfSetup method per test instead of per class
- Need to add more flexible support for future .NET Core 2.* versions HOT 1
- dotnet-nbench can accidentally try to execute [assembly-name].deps.json instead of the assembly HOT 5
- Need to add support for using different benchmark values for different frameworks
- dotnet nbench command fails with the error "Version for package `dotnet-nbench` could not be resolved." HOT 1
- TestFixtureSource not supported HOT 2
- Problem with loading satellite assemblies (.resources) HOT 1
- ReadMe cuts off mid-explanation HOT 1
- Need to add .NET Core 3.0 support HOT 1
- RunTimeMilliseconds not working properly HOT 3
- dotnet exec needs a managed .dll or .exe extension HOT 1
- Linux: can't set processor affinity without being sudo in some environments HOT 1
- Fix NuGet symbol publishing
- Flaky integration test:
- NBench only detects Assemblies and lists them all as 1 test, no matter the number of tests in the assembly HOT 1
- NBench Exception: %Performance Counter% is not registered on this machine. Please Create it First.
- TestRunner ignores the TestPackage.OutputTargets list
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nbench.