ripdad Posted October 28, 2010 Share Posted October 28, 2010 (edited) - Edit2 - Deleted old scripts and the ones in the thread to avoid confusion Updated UDF with several improvementsGetNetSpeed.au3GetNetSpeed_Example.au3 Edited December 11, 2010 by ripdad "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
Ascend4nt Posted October 28, 2010 Share Posted October 28, 2010 Hmm, you know.. since thats a Performance Counter, I've been looking for some type of counter reflecting 'TCP bytes received/sent', but all there is available is 'segments per sec'. I *can* however get Network Interface bytes sent/received (counter "\Network Interface(*)\Bytes Sent/sec" for example). (I'm using the Performance Counters UDF in my signature btw) My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
ripdad Posted October 28, 2010 Author Share Posted October 28, 2010 hi Ascend4nt, I found the base code in AI_Scriptomatic - then adapted it to the code above. I was looking for "something small" to fit into a script I'm working on. It's not perfect but it works okay. I've seen other network speed codes on the forum - but they we're a bit much, not easily adaptable or for InetGet. I did run your Performance Counters code. Very nice. I know you put alot of work into those UDF's. Would you do anything different with the script above? Would value your opinion. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
Zibit Posted October 28, 2010 Share Posted October 28, 2010 Well done. you could make this a UDF. Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam Link to comment Share on other sites More sharing options...
Ascend4nt Posted October 28, 2010 Share Posted October 28, 2010 I did some performance tests, and as I had thought, the results are indeed drawn from these performance counters: "\Network Interface(*)\Bytes Received/sec" "\Network Interface(*)\Bytes Sent/sec" ripdad, check out my TestPDH_NetworkUsage UDF to see how I get the network performance results. You'll see if you compare it to your UDF that it returns the same data (only, I don't do the division). I'd like to do *Internet* Usage, but I would have to grab TCP, UDP, and maybe IP(?) counters.. and then figure out what datagrams and segments mean in terms of bytes.. or even if they are set sizes..? *shrug* Anyway, ripdad - as far as your UDF goes, if it works for you, then go with it. I don't see a problem with it, other than a personal preference to avoid using WMI (I avoid it due to its slow speed). My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
ripdad Posted October 29, 2010 Author Share Posted October 29, 2010 (edited) Ascend4nt,I checked out your TestPDH_NetworkUsage UDF. I'll look more into it soon.I ran a test with FireFox and compared speeds between the two. It seems to be on par with FF.Although, it seems FF has a slower decay.Since there's a 2 second delay on the function - I'm not too worried about WMI being slow on this one.It seems to do what I wanted it to do. Thanks for your reply.Updated 1st post Edited October 29, 2010 by ripdad "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
flashlab Posted December 9, 2010 Share Posted December 9, 2010 THANKS ripdad It's really wonderful job! The downloadspeed is reasonable.But the UPload speed keeps zero. Can you help me ? Link to comment Share on other sites More sharing options...
ripdad Posted December 9, 2010 Author Share Posted December 9, 2010 (edited) flashlab,I don't know what could be causing that.Normally, download spead will be much higher than upload. ( 10 to 1 ratio or more )-Edit-I think Round() is truncating the string. I replaced it with StringLeft(). Edited December 11, 2010 by ripdad "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
flashlab Posted December 10, 2010 Share Posted December 10, 2010 ripdad I don't think trouble comes from formating data. Maybe the WMI doesn't working fine. When there's no data transfer action(the down and up speed should keep zero or very low ),the down/upload speed display may rocket to 3 or 4 and then fall to zero as normal. And I can't get a upload speed display which is lower than 1.00. it's really confusing Thank you for your response Link to comment Share on other sites More sharing options...
flashlab Posted December 10, 2010 Share Posted December 10, 2010 Sorry I don't know how to edit my posthere is the picture:GIF movie Link to comment Share on other sites More sharing options...
ripdad Posted December 10, 2010 Author Share Posted December 10, 2010 (edited) deleted Edited December 11, 2010 by ripdad "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
flashlab Posted December 10, 2010 Share Posted December 10, 2010 (edited) it seems nothing has changed. the upload speed keeps 0(not 0.00000) or larger than 4 I test on win7 OS, and it works fine.But error occured on another XP OS... ====edit1========================================== IF I rewrite $UNowBytes = ($obj.BytesSentPerSec - $UPStartBytes) / 1024 / 1024 to $UNowBytes = ($obj.BytesSentPerSec + $UPStartBytes) / 1024 / 1024 the upload speed range from 0.022 to 0.025. the error is: Line 12 Sub script uses a non-array variable ====edit2========================================== I've read your code carefully. and I paste a modified version.Please check it~ ====edit3========================================== it seems there's something wrong with my adapter, I can't get any upload data from Packet Scheduler Miniport with any tools.GetNetSpeed.au3 Edited December 11, 2010 by flashlab Link to comment Share on other sites More sharing options...
ripdad Posted December 10, 2010 Author Share Posted December 10, 2010 (edited) Go to YouTube and watch a video. Let me know your findings.It works fine here. I don't know what could be wrong if this doesn't work for you.What operating system are you running?-Edit-What was the error? Edited December 10, 2010 by ripdad "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ripdad Posted December 10, 2010 Author Share Posted December 10, 2010 Well, hmmm. The script "assumes" that some type of value would be in $obj.BytesSentPerSec and $obj.BytesReceivedPerSec. I didn't think it would be otherwise. That would indicate that WMI is not returning a value for $obj.BytesSentPerSec. Guess I'll have to prepare the script for that event with something like: If Not $UPStartBytes Then $UPStartBytes = 0 Thanks ... I'll look into it later on today. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ripdad Posted December 11, 2010 Author Share Posted December 11, 2010 Updated first postflashlab, Let me know if this helps. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
ripdad Posted December 11, 2010 Author Share Posted December 11, 2010 (edited) flashlab, First of all ... you don't need to keep editing your last post to reply. People around here might think I'm talking to a ghost! <grin> Here's the situation: The reason I used these ---> StringIsDigit($DnBytes) and StringIsDigit($UpBytes) There's not supposed to be anything else other than a "positive number" from the WMI query. I have no idea where it came from ... but I saw a "negative number" as I was testing it. Hence, the code in the UDF that I added. So, I have no idea why you want to do this: If Not StringIsDigit($DnBytes) Then ConsoleWrite("not return a D number" & "--" & $DnBytes & @CRLF) $DnBytes = 0 Else ConsoleWrite("return D as a number" & "--" & $DnBytes & @CRLF) EndIf I guess there's no harm .. but what is "D"? Also, I'm not sure if you have this. But it might help to you. This is where I got the base code for the UDF. It will show info about your network and adapters.WMI_NetworkInfo.au3 Edited December 11, 2010 by ripdad "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
flashlab Posted December 11, 2010 Share Posted December 11, 2010 Our discussion is not improving the code,but solving my own problem. I just don't want to use too much layout. the program works fine on every computer except mine =@= Maybe I will choose reinstall system. And the additional code record return value to find error. I've forgotten to remove it. Link to comment Share on other sites More sharing options...
ripdad Posted December 11, 2010 Author Share Posted December 11, 2010 Okay. Well, good luck with it. I am glad I took another look at the UDF. It gave me some new ideas. Take care. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
Ascend4nt Posted December 11, 2010 Share Posted December 11, 2010 flashlab, before you go reinstalling your O/S, try my especially the Network Usage example (seen in ). My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now