HardwareStress( click en la imagen para descargar la librería o el código fuente )
HardwareStress es una biblioteca .NET que proporciona un mecanismo para estresar los recursos de hardware, como la CPU, disco o memoria RAM.
Como cualquier otro software enfocado para estresar los recursos de hardware, usted debe usarlo bajo su propio riesgo. No me responsabilizo de un error de hardware.
DonacionesCualquier código dentro del espacio de nombres "DevCase" se distribuye libremente como parte del código fuente comercial de "DevCase for .NET Framework".
Tal vez te gustaría considerar comprar este conjunto de bibliotecas para apoyarme. Puede hacer un montón de cosas con mis bibliotecas para una gran cantidad de temáticas diversas, no solo relacionadas con hardware, etc.
Aquí hay un enlace a la página de compra:
Muchas gracias.
UsoEl uso es muy simple, hay 3 clases:
CpuStress,
DiskStress y
MemoryStress que proporciona un método
Allocate() para comenzar a estresar los recursos, y un método
Deallocate() para detenerlo.
Ejemplos de usoCPU Stress
Using cpuStress As New CpuStress()
Dim percentage As Single = 20.5F 20.50%
Console.WriteLine("Allocating CPU usage percentage...")
cpuStress.Allocate(percentage)
Thread.Sleep(TimeSpan.FromSeconds(5))
Console.WriteLine("Instance CPU average usage percentage: {0:F2}%", cpuStress.InstanceCpuPercentage)
Console.WriteLine("Process CPU average usage percentage: {0:F2}%", cpuStress.ProcessCpuPercentage)
Console.WriteLine()
Console.WriteLine("Deallocating CPU usage percentage...")
cpuStress.Deallocate()
Thread.Sleep(TimeSpan.FromSeconds(5))
Console.WriteLine("Instance CPU average usage percentage: {0:F2}%", cpuStress.InstanceCpuPercentage)
Console.WriteLine("Process CPU average usage percentage: {0:F2}%", cpuStress.ProcessCpuPercentage)
End Using
Disk Stress
Using diskStress As New DiskStress()
Console.WriteLine("Allocating disk I/O read and write operations...")
diskStress.Allocate(fileSize:=1048576) 1 MB
Thread.Sleep(TimeSpan.FromSeconds(10))
Console.WriteLine("Stopping disk I/O read and write operations...")
diskStress.Deallocate()
Console.WriteLine()
Console.WriteLine("Instance disk I/O read operations count: {0} (total of files read)", diskStress.InstanceReadCount)
Console.WriteLine("Process disk I/O read operations count: {0}", diskStress.ProcessReadCount)
Console.WriteLine()
Console.WriteLine("Instance disk I/O read data (in bytes): {0} ({1:F2} GB)", diskStress.InstanceReadBytes, (diskStress.InstanceReadBytes / 1024.0F ^ 3))
Console.WriteLine("Process disk I/O read data (in bytes): {0} ({1:F2} GB)", diskStress.ProcessReadBytes, (diskStress.ProcessReadBytes / 1024.0F ^ 3))
Console.WriteLine()
Console.WriteLine("Instance disk I/O write operations count: {0} (total of files written)", diskStress.InstanceWriteCount)
Console.WriteLine("Process disk I/O write operations count: {0}", diskStress.ProcessWriteCount)
Console.WriteLine()
Console.WriteLine("Instance disk I/O written data (in bytes): {0} ({1:F2} GB)", diskStress.InstanceWriteBytes, (diskStress.InstanceWriteBytes / 1024.0F ^ 3))
Console.WriteLine("Process disk I/O written data (in bytes): {0} ({1:F2} GB)", diskStress.ProcessWriteBytes, (diskStress.ProcessWriteBytes / 1024.0F ^ 3))
End Using
Memory Stress
Using memStress As New MemoryStress()
Dim memorySize As Long = 1073741824 1 GB
Console.WriteLine("Allocating physical memory size...")
memStress.Allocate(memorySize)
Console.WriteLine("Instance Physical Memory Size (in bytes): {0} ({1:F2} GB)", memStress.InstancePhysicalMemorySize, (memStress.InstancePhysicalMemorySize / 1024.0F ^ 3))
Console.WriteLine("Process Physical Memory Size (in bytes): {0} ({1:F2} GB)", memStress.ProcessPhysicalMemorySize, (memStress.ProcessPhysicalMemorySize / 1024.0F ^ 3))
Console.WriteLine()
Console.WriteLine("Deallocating physical memory size...")
memStress.Deallocate()
Console.WriteLine("Instance Physical Memory Size (in bytes): {0}", memStress.InstancePhysicalMemorySize)
Console.WriteLine("Process Physical Memory Size (in bytes): {0} ({1:F2} MB)", memStress.ProcessPhysicalMemorySize, (memStress.ProcessPhysicalMemorySize / 1024.0F ^ 2))
End Using