Documentation ¶
Index ¶
- Constants
- Variables
- func CLIFloodPing(url string, packets int, password string) (*string, error)
- func CLIPing(url string, packets int) (*string, error)
- func Decode(b tsdb.Block) interface{}
- func GetHash(s string) string
- func SendGETRequest(url string) *http.Response
- func VerifyConnection() (bool, int)
- type FloodPing
- type FloodPingResp
- type JitterResp
- type Ping
- type PingResp
- type Response
- type ResponseResp
- type TypeFloodPingScrap
- type TypePingScrap
Constants ¶
const ( // ConfigurationFilePath is the constant path to the configuration file needed to start the application // written from root file since the application starts from `make run` ConfigurationFilePath = "local-config.yml" // PathPing stores the defualt address of storage directory of ping data PathPing = "storage/ping" // PathJitter stores the defualt address of storage directory of jitter data PathJitter = "storage/jitter" // PathFloodPing stores the defualt address of storage directory of flood ping data PathFloodPing = "storage/flood-ping" // PathReqResDelayMonitoring stores the defualt address of storage directory of req-res and monitoring data PathReqResDelayMonitoring = "storage/req-res-delay-monitoring" )
const ( CmdPingBasedOnPacketsNumber = "ping" CmdAdministrator = "sudo" CmdEcho = "echo" )
cli command base
Variables ¶
var ( // PingDBNames contains the name of the database corresponding to the unique config url PingDBNames = make(map[string]string) // FloodPingDBNames contains the name of the flood ping corresponding to the unique config url FloodPingDBNames = make(map[string]string) // Pingc contains chains of all the pings operating in bench-routes which has to be globally accessed // This is necessary as it helps to retain the parent values which are required for concurreny Pingc []*tsdb.Chain // Jitterc is the global chain array which can be used to maintain a list of chains that represent // the time-series values Jitterc []*tsdb.Chain // FPingc contains chains of flood ping operations in bench-routes which has to be globally accessed // This is necessary as it helps to retain the parent values which are required for concurreny FPingc []*tsdb.Chain // RespMonitoringc stands for Request-Response-Delay RespMonitoringc []*tsdb.Chain )
Functions ¶
func CLIFloodPing ¶
CLIFloodPing in another subroutine, for ping operation with -f flag which sends multiple ping request at once i.e. floods the url with requests.
func CLIPing ¶
CLIPing works as an *independent subroutine*, for ping operations with the external networks Takes in a pointer channel in the last params inorder to implement subroutines since the ping operations might take time thereby avoiding delay in the other operations Use of pointers necessary since the data received is of large size, thereby slowing the traditional method of variables, as using variables require the time involved in loading into and out from cpu registers. Specifying addresses directly speeds the entire process manyfolds.
func GetHash ¶
GetHash returns an unique hash code which can be used for storing values in tsdb for long urls
func SendGETRequest ¶
SendGETRequest sends http GET request to the specified url(both resp_delay and monitor_response_status module use it)
func VerifyConnection ¶
VerifyConnection verifies the connectivity of the program with the external network
Types ¶
type FloodPingResp ¶
type FloodPingResp struct { Min float64 `json:"Min"` Mean float64 `json:"Mean"` Max float64 `json:"Max"` MDev float64 `json:"MDev"` PacketLoss float64 `json:"PacketLoss"` NormalizedTime int64 `json:"NormalizedTime"` Timestamp string `json:"Timestamp"` Relative int `json:"relative"` }
FloodPingResp type for storing Ping values in TSDB
type JitterResp ¶
type JitterResp struct { Datapoint float64 `json:"datapoint"` NormalizedTime int64 `json:"NormalizedTime"` Timestamp string `json:"Timestamp"` Relative int `json:"relative"` }
JitterResp type for storing Ping values in TSDB
type PingResp ¶
type PingResp struct { Min float64 `json:"Min"` Mean float64 `json:"Mean"` Max float64 `json:"Max"` MDev float64 `json:"MDev"` NormalizedTime int64 `json:"NormalizedTime"` Timestamp string `json:"Timestamp"` Relative int `json:"relative"` }
PingResp type for storing Ping values in TSDB
type Response ¶
Response struct This is the object that we return from resp_delay module Contains delay in response and the response length
type ResponseResp ¶
type ResponseResp struct { Delay int `json:"delay"` ResLength int `json:"resLength"` ResStatusCode int `json:"resStatusCode"` NormalizedTime int64 `json:"NormalizedTime"` Timestamp string `json:"Timestamp"` Relative int `json:"relative"` }
ResponseResp for responding the querier.
type TypeFloodPingScrap ¶
type TypeFloodPingScrap struct {
Min, Avg, Max, Mdev, PacketLoss float64
}
TypeFloodPingScrap as datatype for flood ping outputs
type TypePingScrap ¶
type TypePingScrap struct {
Min, Avg, Max, Mdev float64
}
TypePingScrap as datatype for ping outputs