getting disk throughput
-
Is there a known way of getting disk throughput? I suppose it has something to do with performance counters, but I'm not sure how to use them properly.. :doh: Does anyone know a good article, link, or something..? I'd be most gratefull :cool: --- http://sprdsoft.cmar-net.org - We Sprd You Softly Our site features contents and several images. All of this is very weird. In the end, war is not about who's right, it's about who's left.
-
Is there a known way of getting disk throughput? I suppose it has something to do with performance counters, but I'm not sure how to use them properly.. :doh: Does anyone know a good article, link, or something..? I'd be most gratefull :cool: --- http://sprdsoft.cmar-net.org - We Sprd You Softly Our site features contents and several images. All of this is very weird. In the end, war is not about who's right, it's about who's left.
T1TAN wrote:
I suppose it has something to do with performance counters, but I'm not sure how to use them properly...
But do you know which one you are interested in?
"Take only what you need and leave the land as you found it." - Native American Proverb
-
T1TAN wrote:
I suppose it has something to do with performance counters, but I'm not sure how to use them properly...
But do you know which one you are interested in?
"Take only what you need and leave the land as you found it." - Native American Proverb
Hm. Good question indeed. I believe it's this one: LogicalDisk|PhysicalDisk\Disk Bytes/sec "Indicates the rate at which bytes are transferred and is the primary measure of disk throughput. To analyze transfer data based on reads and writes, use Disk Read Bytes/sec and Disk Write Bytes/sec, respectively." This[^] is all I could find.. :doh: --- http://sprdsoft.cmar-net.org - We Sprd You Softly Our site features contents and several images. All of this is very weird. In the end, war is not about who's right, it's about who's left.
-
Hm. Good question indeed. I believe it's this one: LogicalDisk|PhysicalDisk\Disk Bytes/sec "Indicates the rate at which bytes are transferred and is the primary measure of disk throughput. To analyze transfer data based on reads and writes, use Disk Read Bytes/sec and Disk Write Bytes/sec, respectively." This[^] is all I could find.. :doh: --- http://sprdsoft.cmar-net.org - We Sprd You Softly Our site features contents and several images. All of this is very weird. In the end, war is not about who's right, it's about who's left.
T1TAN wrote:
LogicalDisk|PhysicalDisk\Disk Bytes/sec
It would look something like:
HQUERY hQuery = NULL;
PDH_STATUS pdhStatus = PdhOpenQuery(NULL, 0, &hQuery);// Make counter path
PDH_COUNTER_PATH_ELEMENTS pdhCpe;
pdhCpe.szMachineName = TEXT("server");
pdhCpe.szObjectName = TEXT("LogicalDisk");
pdhCpe.szInstanceName = TEXT("C:");
pdhCpe.szParentInstance = NULL;
pdhCpe.dwInstanceIndex = -1;
pdhCpe.szCounterName = TEXT("Disk Bytes/sec");
DWORD dwBufferSize = sizeof(szBytesSec);
TCHAR szBytesSec[128];
pdhStatus = PdhMakeCounterPath(&pdhCpe, szBytesSec, &dwBufferSize, 0);// Add counter
HCOUNTER hBytesSec;
pdhStatus = PdhAddCounter(hQuery, szBytesSec, 0, &hBytesSec);// Get the data
pdhStatus = PdhCollectQueryData(hQuery);// Format counter value
PDH_FMT_COUNTERVALUE pdhfmtBytesSec;
pdhStatus = PdhGetFormattedCounterValue(hBytesSec, PDH_FMT_LONG, NULL, &pdhfmtBytesSec);pdhStatus = PdhCloseQuery(hQuery);
"Take only what you need and leave the land as you found it." - Native American Proverb
-- modified at 9:28 Monday 12th December, 2005
-
T1TAN wrote:
LogicalDisk|PhysicalDisk\Disk Bytes/sec
It would look something like:
HQUERY hQuery = NULL;
PDH_STATUS pdhStatus = PdhOpenQuery(NULL, 0, &hQuery);// Make counter path
PDH_COUNTER_PATH_ELEMENTS pdhCpe;
pdhCpe.szMachineName = TEXT("server");
pdhCpe.szObjectName = TEXT("LogicalDisk");
pdhCpe.szInstanceName = TEXT("C:");
pdhCpe.szParentInstance = NULL;
pdhCpe.dwInstanceIndex = -1;
pdhCpe.szCounterName = TEXT("Disk Bytes/sec");
DWORD dwBufferSize = sizeof(szBytesSec);
TCHAR szBytesSec[128];
pdhStatus = PdhMakeCounterPath(&pdhCpe, szBytesSec, &dwBufferSize, 0);// Add counter
HCOUNTER hBytesSec;
pdhStatus = PdhAddCounter(hQuery, szBytesSec, 0, &hBytesSec);// Get the data
pdhStatus = PdhCollectQueryData(hQuery);// Format counter value
PDH_FMT_COUNTERVALUE pdhfmtBytesSec;
pdhStatus = PdhGetFormattedCounterValue(hBytesSec, PDH_FMT_LONG, NULL, &pdhfmtBytesSec);pdhStatus = PdhCloseQuery(hQuery);
"Take only what you need and leave the land as you found it." - Native American Proverb
-- modified at 9:28 Monday 12th December, 2005
Thanx! Will give it a try and let you know how it worked:cool: Do you think I could use this code with
CPerfCounters
class located in this[^] article? Is there a way to get the maximum bytes per sec?? I would like to get the percentage of max disk throughput if possible:) thanx again DC:rose: --- http://sprdsoft.cmar-net.org - We Sprd You Softly Our site features contents and several images. All of this is very weird. In the end, war is not about who's right, it's about who's left. -
Thanx! Will give it a try and let you know how it worked:cool: Do you think I could use this code with
CPerfCounters
class located in this[^] article? Is there a way to get the maximum bytes per sec?? I would like to get the percentage of max disk throughput if possible:) thanx again DC:rose: --- http://sprdsoft.cmar-net.org - We Sprd You Softly Our site features contents and several images. All of this is very weird. In the end, war is not about who's right, it's about who's left.T1TAN wrote:
Do you think I could use this code with CPerfCounters class located in this[^] article?
Not sure. How about asking the article's author?
T1TAN wrote:
Is there a way to get the maximum bytes per sec??
Sure. Each time the value is obtained, store the highest value in a separate variable.
"Take only what you need and leave the land as you found it." - Native American Proverb
-
T1TAN wrote:
Do you think I could use this code with CPerfCounters class located in this[^] article?
Not sure. How about asking the article's author?
T1TAN wrote:
Is there a way to get the maximum bytes per sec??
Sure. Each time the value is obtained, store the highest value in a separate variable.
"Take only what you need and leave the land as you found it." - Native American Proverb
DavidCrow wrote:
Not sure. How about asking the article's author?
Em, yeah..that seems like a good idea..:-O
DavidCrow wrote:
Sure. Each time the value is obtained, store the highest value in a separate variable.
Oh I didn't mean that highest value, what I meant was: is there a way to get the maximum throughput that could ever happen on a specific drive?:doh: Not the highest one I've ever measured. I'm not really sure this is possible. I suppose each drive has its own throughput limit..:confused: --- http://sprdsoft.cmar-net.org - We Sprd You Softly Our site features contents and several images. All of this is very weird. In the end, war is not about who's right, it's about who's left.