Documentation ¶
Index ¶
Constants ¶
View Source
const CFG_DOWNLOAD_SIZES = "downloadSizes"
View Source
const CFG_MAX_SECONDS = "maxSeconds"
View Source
const CFG_SERVER_HOST = "Host"
View Source
const CFG_SERVER_ID = "serverID"
View Source
const CFG_TEST_TYPE = "testType"
View Source
const CFG_TIME_OUT = "timeOut"
View Source
const CFG_TYPE_ALL = "allTests"
View Source
const CFG_TYPE_DOWNLOAD = "downloadTest"
View Source
const CFG_TYPE_LATENCY = "latencyTest"
View Source
const CFG_TYPE_SPEED_TEST = "speedTest"
View Source
const CFG_TYPE_UPLOAD = "uploadTest"
View Source
const CFG_UPLOAD_SIZES = "uploadSizes"
View Source
const MillisecondInt64 = int64(time.Millisecond)
Variables ¶
View Source
var Task agent.Task
Functions ¶
func DownloadTest ¶
DownloadTest - controls Downloader goroutine @param server - a pointer to a server @param length - the maximum number of seconds this upload is allowed to take @param sizes - if this is left empty, then ten default sizes will be
used each bigger than the previous one
func GetServerByID ¶
func GetServerByID(id string) server
func LatencyTest ¶
func LatencyTest(server *server)
Tests the latency of the server in question and registers the value in server.Speedtest.Results.Latency
func UploadTest ¶
Function that controls Uploader goroutine @param server - a pointer to a speedtest.Server @param length - the maximum number of seconds this upload is allowed to take @param sizes - if this is left empty, then seven default sizes will be
used each bigger than the previous one
Types ¶
type SpeedTestRunner ¶
type SpeedTestRunner struct{}
func (SpeedTestRunner) Run ¶
func (s SpeedTestRunner) Run(taskData agent.TaskData) (agent.SpeedTestResults, error)
Run ensures all the needed agent.TaskData values are present and valid and
runs a Latency Test as well as any other requested test(s) Here are the required values ... taskData.IntValues: - CFG_SERVER_ID - CFG_TIME_OUT taskData.StringValues: - CFG_SERVER_HOST - CFG_TEST_TYPE ... CFG_TYPE_ALL | CFG_TYPE_DOWNLOAD | CFG_TYPE_LATENCY | CFG_TYPE_UPLOAD taskData.FloatValues: - CFG_MAX_SECONDS ... (not required for Latency Tests) taskData.IntSlices: - CFG_DOWNLOAD_SIZES ... (only required for Download Tests) - CFG_UPLOAD_SIZES ... (only required for Upload Tests)
Click to show internal directories.
Click to hide internal directories.