Jump to content

Upload / Download Speed


ripdad
 Share

Recommended Posts

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)

Link to comment
Share on other sites

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

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).

Link to comment
Share on other sites

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 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

  • 1 month later...

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 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

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

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~ :x

====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 by flashlab
Link to comment
Share on other sites

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 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

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

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 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

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

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

flashlab, before you go reinstalling your O/S, try my especially the Network Usage example (seen in ).

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...