Documentation ¶
Index ¶
- Constants
- Variables
- func AddErrorInfo(errorInfo ErrorInfo)
- func AddNew(databaseTypes DatabaseTypes)
- func AddRequestInfo(requestInfo RequestInfo)
- func EnableLogging(fileName string)
- func Initialize(ids map[int]int64, mMeanResponseCount int, mErrorCount int)
- type Database
- type DatabaseTypes
- type ErrorInfo
- type InfluxDb
- func (influxDb InfluxDb) AddErrorInfo(errorInfo ErrorInfo) error
- func (influxDb InfluxDb) AddRequestInfo(requestInfo RequestInfo) error
- func (influxDb InfluxDb) GetDatabaseName() string
- func (influxDb InfluxDb) GetMeanResponseTime(Url string, span int) (float64, error)
- func (influxDb InfluxDb) Initialize() error
- type RequestInfo
Constants ¶
View Source
const (
DatabaseName = "InfluxDB"
)
Variables ¶
View Source
var ( MeanResponseCount = 5 //Default number of response times to calcuate mean response time ErrorCount = 1 //Default number of errors should occur to send notification ErrResposeCode = errors.New("Response code do not Match") ErrTimeout = errors.New("Request Time out Error") ErrCreateRequest = errors.New("Invalid Request Config.Not able to create request") ErrDoRequest = errors.New("Request failed") )
Functions ¶
func AddErrorInfo ¶
func AddErrorInfo(errorInfo ErrorInfo)
This function is called by requests package when a reuquest fails Error Information is inserted to all the registered databases
func AddRequestInfo ¶
func AddRequestInfo(requestInfo RequestInfo)
This function is called by requests package when request has been successfully performed Request data is inserted to all the registered databases
func EnableLogging ¶
func EnableLogging(fileName string)
Types ¶
type DatabaseTypes ¶
type DatabaseTypes struct {
InfluxDb InfluxDb `json:"influxDb"`
}
type InfluxDb ¶
type InfluxDb struct { Host string `json:"host"` Port int `json:"port"` DatabaseName string `json:"databaseName"` Username string `json:"username"` Password string `json:"password"` }
func (InfluxDb) AddErrorInfo ¶
Add Error information to database
func (InfluxDb) AddRequestInfo ¶
func (influxDb InfluxDb) AddRequestInfo(requestInfo RequestInfo) error
Add request information to database
func (InfluxDb) GetDatabaseName ¶
Return database name
func (InfluxDb) GetMeanResponseTime ¶
Returns mean response time of url in given time .Currentlt not used
Click to show internal directories.
Click to hide internal directories.