Tcl Speed Test 0.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
TclSpeedTest Class Reference

List of all members.

Public Member Functions

 TclSpeedTest (name,...)
 downloadtest (size)
 uploadtest (size)

Static Public Member Functions

static HumanFormatBitsPerSec (bpersec)

Private Member Functions

 _complete (token)
 _uploaddata (token, bufferName)

Static Private Member Functions

static randomprintable ()

Private Attributes

 starttime
 endtime
 complete
 bytesreceived
 remainingbytesuploaded

Static Private Attributes

static testbuffer
static bufsize

Detailed Description

Client side of the Tcl Coded Speed Test


Constructor & Destructor Documentation

TclSpeedTest::TclSpeedTest ( name  ,
  ... 
)

Create a tester instance.

Parameters:
...Options (all readonly):
  • -server The server to test with. Defaults to sharky3.deepsoft.com.
  • -port The port to use. Defaults to 8080.
  • -time The time in sections to test for. Defaults to 10.

Member Function Documentation

TclSpeedTest::_complete ( token  ) [private]

Completion callback function.

Parameters:
tokenThe http token.
TclSpeedTest::_uploaddata ( token  ,
bufferName   
) [private]

The upload data callback function.

Parameters:
tokenThe http token.
bufferNameThe name of a buffer variable to fill up with data.
Returns:
The number of bytes in the buffer or -1 if EOF.
TclSpeedTest::downloadtest ( size  )

Perform one download test.

Asks the server to download a chunk of data.

Parameters:
sizeThe size of the download in megabytes.
Returns:
The number of seconds (accurate to the millisecond) the download took.
static TclSpeedTest::HumanFormatBitsPerSec ( bpersec  ) [static]

Function to format a number of bits per second into some human friendly. The number is reduced and a multiplier is included in the units label appended to the result.

Parameters:
bpersecThe bits per second as an integer.
Returns:
A string representation of the bits per second with a multiplier: k (=1,000), m (=1,000,000), or g (=1,000,000,000) or none if the bpersec < 1000).
static TclSpeedTest::randomprintable ( ) [static, private]

Generate a random printable character.

Returns:
A single printable character.
TclSpeedTest::uploadtest ( size  )

Perform one upload test.

Uploads a chunk of data to the server.

Parameters:
sizeThe size of the upload in megabytes.
Returns:
The number of seconds (accurate to the millisecond) the upload took.

Member Data Documentation

TclSpeedTest::bufsize [static, private]

Buffer size

The number of bytes received.

Completion flag.

The end time.

The number of bytes remaining to be uploaded.

The start time.

TclSpeedTest::testbuffer [static, private]

Test buffer