Documentation
¶
Index ¶
- func CustomEndpoint(filter bson.M) []bson.M
- func CustomGroup(filter bson.M) []bson.M
- func CustomSuperGroup(filter bson.M) []bson.M
- func DailyEndpoint(filter bson.M) []bson.M
- func DailyGroup(filter bson.M) []bson.M
- func DailySuperGroup(filter bson.M) []bson.M
- func GetAvailability(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func GetStatus(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func GetUptime(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler)
- func MonthlyEndpoint(filter bson.M) []bson.M
- func MonthlyGroup(filter bson.M) []bson.M
- func MonthlySuperGroup(filter bson.M) []bson.M
- func Options(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- type Availability
- type Data
- type ErrorResponse
- type GroupInterface
- type GroupStatusData
- type InputStatus
- type NodeReport
- type Results
- type Status
- type StatusData
- type StatusResult
- type Uptime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomEndpoint ¶
CustomEndpoint query to aggregate a/r results from over a custom periodmongoDB Mongo aggregation pipeline Select all the records that match q Group them by their name, their supergroup, their service, etc... from that group find the average of the uptime, u, downtime Project the result to a better format and do this computation availability = (avgup/(1.00000001 - avgu))*100 reliability = (avgup/((1.00000001 - avgu)-avgd))*100 Sort the results by name->service->supergroup
func CustomGroup ¶
CustomGroup query to aggregate custom results from mongodb
func CustomSuperGroup ¶
CustomSuperGroup function to build the MongoDB aggregation query for monthly calculations
func DailyEndpoint ¶
DailyEndpoint query to aggregate daily endpoint a/r results from mongoDB Mongo aggregation pipeline Select all the records that match q Project to select just the first 8 digits of the date YYYYMMDD Sort by name->service->supergroup->date
func DailyGroup ¶
DailyGroup query to aggregate daily results from mongodb
func DailySuperGroup ¶
DailySuperGroup function to build the MongoDB aggregation query for daily calculations
func GetAvailability ¶
GetAvailability lists group availabilities according to the http request
func HandleSubrouter ¶
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler)
HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts handling each route with a different subrouter
func MonthlyEndpoint ¶
MonthlyEndpoint query to aggregate monthly a/r results from mongoDB Mongo aggregation pipeline Select all the records that match q Group them by the first six digits of their date (YYYYMM), their name, their supergroup, their service, etc... from that group find the average of the uptime, u, downtime Project the result to a better format and do this computation availability = (avgup/(1.00000001 - avgu))*100 reliability = (avgup/((1.00000001 - avgu)-avgd))*100 Sort the results by name->service->supergroup->date
func MonthlyGroup ¶
MonthlyGroup query to aggregate monthly results from mongodb
func MonthlySuperGroup ¶
MonthlySuperGroup function to build the MongoDB aggregation query for monthly calculations
Types ¶
type Availability ¶
type Data ¶
type Data[T Availability | Uptime] struct { Data []Results[T] `json:"data"` }
type ErrorResponse ¶
type ErrorResponse respond.ErrorResponse
ErrorResponse shortcut to respond.ErrorResponse
type GroupInterface ¶
type GroupInterface struct {
Name string `bson:"name"`
Report string `bson:"report"`
Date string `bson:"date"`
Type string `bson:"type"`
Up float64 `bson:"up"`
Down float64 `bson:"down"`
Unknown float64 `bson:"unknown"`
Availability float64 `bson:"availability"`
Reliability float64 `bson:"reliability"`
Weights string `bson:"weights"`
SuperGroup string `bson:"supergroup"`
}
GroupInterface used to hold mongodb group information such as SITES, SERVICEGROUPS etc
type GroupStatusData ¶
type InputStatus ¶
type InputStatus struct {
ID string
// contains filtered or unexported fields
}
type NodeReport ¶
type NodeReport struct {
ReportId string `bson:"report_id"`
}
type Results ¶
type Results[T Availability | Uptime] struct { Name string `json:"name"` Results []T `json:"results"` }
type Status ¶
type Status struct {
Name string `json:"name"`
Results []StatusResult `json:"results"`
}
type StatusData ¶
type StatusData struct {
Data []Status `json:"data"`
}