简体   繁体   English

如何编写可以测试磁盘吞吐量的程序?

[英]How can I write a program which can test throughput of disk?

How can I write a program which can test throughput of disk in Windows systems using c++?如何使用 c++ 编写可以测试 Windows 系统中磁盘吞吐量的程序?

What's the mainly steps and APIs that I can use to programming?我可以用来编程的主要步骤和 API 是什么?

In outline:概述:

  • write a known (large) amount of data to disk ( see write() )将已知(大量)数据写入磁盘(参见 write() )
  • start clock (see time() or clock() )开始时钟(见 time() 或 clock() )
  • read data from disk (see read() )从磁盘读取数据(参见 read() )
  • stop clock (see above)停止时钟(见上文)
  • report results (see cout)报告结果(见 cout)

One open-source benchmark is bonnie , which mostly uses the standard C API.一个开源基准是bonnie ,它主要使用标准 C API。 You'll need to change some of the timing functions to suit Windows.您需要更改一些计时功能以适应 Windows。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM