Jump to content
Sign in to follow this  
botanic

current disk i/o?

Recommended Posts

botanic

how can i get the current disk read write?

Edited by botanic

Share this post


Link to post
Share on other sites
PsaltyDS

how can i get the current disk read write?

If diskperf is turned on, you should be able to get stats from WMI. Use Scriptomatic to find the object you need (i.e. Win32_PerfRawData_PerfDisk_PhysicalDisk).

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
botanic

ok i tried using this just im not getting any data returned :/

Func _ComputerGetDisk(ByRef $aDiskInfo)
    Local $colItems, $objWMIService, $objItem
    Dim $aDiskInfo[1][21], $i = 1
    
    $objWMIService = ObjGet("winmgmts:\\" & $cI_Compname & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_PerfFormattedData_PerfDisk_LogicalDisk", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    
    If IsObj($colItems) Then
        For $objItem In $colItems
            ReDim $aDiskInfo[UBound($aDiskInfo) + 1][21]
            $aDiskInfo[$i][0]  = $objItem.Name
              $aDiskInfo[$i][1]  = $objItem.AvgDiskBytesPerRead
              $aDiskInfo[$i][2]  = $objItem.AvgDiskBytesPerTransfer
              $aDiskInfo[$i][3]  = $objItem.AvgDiskBytesPerWrite
              $aDiskInfo[$i][4]  = $objItem.AvgDiskQueueLength
              $aDiskInfo[$i][5]  = $objItem.AvgDiskReadQueueLength
              $aDiskInfo[$i][6]  = $objItem.AvgDisksecPerRead
              $aDiskInfo[$i][7]  = $objItem.AvgDisksecPerTransfer
              $aDiskInfo[$i][8]  = $objItem.AvgDisksecPerWrite
              $aDiskInfo[$i][9]  = $objItem.AvgDiskWriteQueueLength
              $aDiskInfo[$i][10]  = $objItem.Caption
              $aDiskInfo[$i][11]  = $objItem.CurrentDiskQueueLength
              $aDiskInfo[$i][12]  = $objItem.Description
              $aDiskInfo[$i][13]  = $objItem.DiskBytesPersec
              $aDiskInfo[$i][14]  = $objItem.DiskReadBytesPersec
              $aDiskInfo[$i][15]  = $objItem.DiskReadsPersec
              $aDiskInfo[$i][16]  = $objItem.DiskTransfersPersec
              $aDiskInfo[$i][17]  = $objItem.DiskWriteBytesPersec
              $aDiskInfo[$i][18]  = $objItem.DiskWritesPersec
              $aDiskInfo[$i][19]  = $objItem.FreeMegabytes
              $aDiskInfo[$i][20]  = $objItem.Frequency_Object
              $aDiskInfo[$i][21]  = $objItem.Frequency_PerfTime
              $aDiskInfo[$i][22]  = $objItem.Frequency_Sys100NS
              $aDiskInfo[$i][23]  = $objItem.Name
              $aDiskInfo[$i][24]  = $objItem.PercentDiskReadTime
              $aDiskInfo[$i][25]  = $objItem.PercentDiskTime
              $aDiskInfo[$i][26]  = $objItem.PercentDiskWriteTime
              $aDiskInfo[$i][27]  = $objItem.PercentFreeSpace
              $aDiskInfo[$i][28]  = $objItem.PercentIdleTime
              $aDiskInfo[$i][29]  = $objItem.SplitIOPerSec
              $aDiskInfo[$i][30]  = $objItem.Timestamp_Object
              $aDiskInfo[$i][31]  = $objItem.Timestamp_PerfTime
              $aDiskInfo[$i][32]  = $objItem.Timestamp_Sys100NS
                    $i += 1
        Next
        $aDiskInfo[0][0] = UBound($aDiskInfo) - 1
        If $aDiskInfo[0][0] < 1 Then
            SetError(1, 1, 0)
        EndIf
    Else
        SetError(1, 2, 0)
    EndIf
EndFuncoÝ÷ Ú׬¶Ç+ZºÚ"µÍÚ[ÛYH   ][ÝÐÛÛ[Ë]LÉ][ÝÂ[H   ÌÍÙÚÂÐÛÛ]Ù]ÚÊ    ÌÍÙÚÊBÙÐÞ
    ][ÝÉ][ÝË    ÌÍÙÚÖÌVÌMWJ

not getting any errors ;/

Edited by botanic

Share this post


Link to post
Share on other sites
PsaltyDS

ok i tried using this just im not getting any data returned :/

not getting any errors ;/

You'll have to use a "Refresher" with time-based Perf data. Look inside my _ProcessListProperties() UDF for an example, and do some Googling on it.

:P

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
botanic

ok i managed to get data returned in the form of a 0... and how would i get the refresher working? i just added it onto the end of compinfo.au3

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=..\My Documents\Profile.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include "C:\Program Files\AutoIt3\Include\CompInfo.au3"
Global $total, $total1, $total2

While 1

Dim $Processors
_ComputerGetProcessors($Processors)
$total2 = 0
For $i = 1 To $Processors[0][0] Step 1
    $total2 = $total2 + $Processors[$i][21]
Next
Dim $OSs
IniWrite("C:\Profile.ini", @MON &"/"&@MDAY&"/"& @YEAR &"  "& @HOUR&":"&@MIN,"Load Percentage: ",  ($total2/$Processors[0][0]) & "%" )
_ComputerGetOSs($OSs)
For $i = 1 To $OSs[0][0] Step 1
    $total = $total + $OSs[$i][20]
Next
Dim $Memory
_ComputerGetMemory($Memory)
For $i = 1 To $Memory[0][0] Step 1
    $total1 = $total1 + $Memory[$i][2]
Next
$total1 = $total1/1024
$total = $total1-$total
iniWrite("C:\Profile.ini", @MON &"/"&@MDAY&"/"& @YEAR &"  "& @HOUR&":"&@MIN,"Memory used: ",  $total&"/"&$total1 &" "& StringLeft(100*(($total)/$total1),2) & "%" )
Dim $disk
_ComputerGetDisk($disk)
For $i = 1 To $disk[0][0] Step 1
        IniWrite("C:\Profile.ini", @MON &"/"&@MDAY&"/"& @YEAR &"  "& @HOUR&":"&@MIN,$disk[$i][22]&" Average Disk Queue Length: ",  $disk[$i][4] )
    IniWrite("C:\Profile.ini", @MON &"/"&@MDAY&"/"& @YEAR &"  "& @HOUR&":"&@MIN,$disk[$i][22]&" Current Disk Queue Length: ",  $disk[$i][11] )
    IniWrite("C:\Profile.ini", @MON &"/"&@MDAY&"/"& @YEAR &"  "& @HOUR&":"&@MIN,$disk[$i][22]&" Percent Disk Time: ",  $disk[$i][24] )
    IniWrite("C:\Profile.ini", @MON &"/"&@MDAY&"/"& @YEAR &"  "& @HOUR&":"&@MIN,$disk[$i][22]&" Disk Bytes Per Sec: ",  $disk[$i][13] )
Next
FileWrite("C:\Profile.ini",@CR)
Sleep(60000)
WEndoÝ÷ Ù§]'¶ayéÝ¡÷(§~®Ý«­¢+ÙÕ¹}
½µÁÕÑÉѥͬ¡  åIÀÌØí¥Í­%¹¼¤(%1½°ÀÌØí½±%ѵ̰ÀÌØí½©]5%MÉÙ¥°ÀÌØí½©%Ñ´(%¥´ÀÌØí¥Í­%¹½lÅulÈÅt°ÀÌØí¤ôÄ($($ÀÌØí½©]5%MÉÙ¥ô=©Ð ÅÕ½ÐíÝ¥¹µµÑÌèÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí%}
½µÁ¹µµÀìÅÕ½ÐìÀäÈíɽ½ÐÀäÈí
%5XÈÅÕ½Ðì¤($ÀÌØí½±%ѵÌôÀÌØí½©]5%MÉÙ¥¹áEÕÉä ÅÕ½ÐíM1
P¨I=4]¥¸ÌÉ}AɽɵÑÑÑ}Aɥͭ}A¡åÍ¥±¥Í¬ÅÕ½Ðì°ÅÕ½Ðí]E0ÅÕ½Ðì°ÀÌØíݵ±IÑÕɹ%µµ¥Ñ±ä¬ÀÌØíݵ±½ÉÝÉ=¹±ä¤($(%%%Í=¨ ÀÌØí½±%ѵ̤Q¡¸($%½ÈÀÌØí½©%Ñ´%¸ÀÌØí½±%ѵÌ($$%I¥´ÀÌØí¥Í­%¹½mU ½Õ¹ ÀÌØí¥Í­%¹¼¤¬ÅulÌÅt($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÁtôÀÌØí½©%Ñ´¹9µ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÅtôÀÌØí½©%Ñ´¹Ù¥Í­  åÑÍAÉI($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÉtôÀÌØí½©%Ñ´¹Ù¥Í­  åÑÍAÉQɹÍÈ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÍtôÀÌØí½©%Ñ´¹Ù¥Í­  åÑÍAÉ]É¥Ñ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÑtôÀÌØí½©%Ñ´¹Ù¥Í­EÕÕ1¹Ñ ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÕtôÀÌØí½©%Ñ´¹Ù¥Í­IEÕÕ1¹Ñ ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÙtôÀÌØí½©%Ñ´¹Ù¥Í­ÍAÉI($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÝtôÀÌØí½©%Ñ´¹Ù¥Í­ÍAÉQɹÍÈ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulátôÀÌØí½©%Ñ´¹Ù¥Í­ÍAÉ]É¥Ñ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulåtôÀÌØí½©%Ñ´¹Ù¥Í­]É¥ÑEÕÕ1¹Ñ ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÄÁtôÀÌØí½©%Ñ´¹
ÁÑ¥½¸($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÄÅtôÀÌØí½©%Ñ´¹
ÕÉɹѥͭEÕÕ1¹Ñ ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÄÉtôÀÌØí½©%Ñ´¹ÍÉ¥ÁÑ¥½¸($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÄÍtôÀÌØí½©%Ñ´¹¥Í­   åÑÍAÉÍ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÄÑtôÀÌØí½©%Ñ´¹¥Í­I    åÑÍAÉÍ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÄÕtôÀÌØí½©%Ñ´¹¥Í­IÍAÉÍ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÄÙtôÀÌØí½©%Ñ´¹¥Í­QɹÍÉÍAÉÍ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÄÝtôÀÌØí½©%Ñ´¹¥Í­]ɥѠ åÑÍAÉÍ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÄátôÀÌØí½©%Ñ´¹¥Í­]É¥ÑÍAÉÍ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÄåtôÀÌØí½©%Ñ´¹ÉÅÕ¹å}=©Ð($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÈÁtôÀÌØí½©%Ñ´¹ÉÅÕ¹å}AÉQ¥µ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÈÅtôÀÌØí½©%Ñ´¹ÉÅÕ¹å}MåÌÄÀÁ9L($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÈÉtôÀÌØí½©%Ñ´¹9µ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÈÍtôÀÌØí½©%Ñ´¹AɹѥͭIQ¥µ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÈÑtôÀÌØí½©%Ñ´¹AɹѥͭQ¥µ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÈÕtôÀÌØí½©%Ñ´¹Aɹѥͭ]É¥ÑQ¥µ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÈÙtôÀÌØí½©%Ñ´¹AɹÑ%±Q¥µ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÈÝtôÀÌØí½©%Ñ´¹MÁ±¥Ñ%=AÉM($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÈátôÀÌØí½©%Ñ´¹Q¥µÍѵÁ}=©Ð($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÈåtôÀÌØí½©%Ñ´¹Q¥µÍѵÁ}AÉQ¥µ($$$ÀÌØí¥Í­%¹½lÀÌØí¥ulÌÁtôÀÌØí½©%Ñ´¹Q¥µÍѵÁ}MåÌÄÀÁ9L($$$$$ÀÌØí¤¬ôÄ($%9áÐ($$ÀÌØí¥Í­%¹½lÁulÁtôU  ½Õ¹ ÀÌØí¥Í­%¹¼¤´Ä($%%ÀÌØí¥Í­%¹½lÁulÁt±ÐìÄQ¡¸($$%MÑÉÉ½È Ä°Ä°À¤($%¹%(%±Í($%MÑÉÉ½È Ä°È°À¤(%¹%)¹Õ¹

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.