nodes

package
v1.14.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2026 License: Apache-2.0, Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomEndpoint

func CustomEndpoint(filter bson.M) []bson.M

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

func CustomGroup(filter bson.M) []bson.M

CustomGroup query to aggregate custom results from mongodb

func CustomSuperGroup

func CustomSuperGroup(filter bson.M) []bson.M

CustomSuperGroup function to build the MongoDB aggregation query for monthly calculations

func DailyEndpoint

func DailyEndpoint(filter bson.M) []bson.M

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

func DailyGroup(filter bson.M) []bson.M

DailyGroup query to aggregate daily results from mongodb

func DailySuperGroup

func DailySuperGroup(filter bson.M) []bson.M

DailySuperGroup function to build the MongoDB aggregation query for daily calculations

func GetAvailability

func GetAvailability(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

GetAvailability lists group availabilities according to the http request

func GetStatus

func GetStatus(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

GetStatus lists group timelines

func GetUptime

func GetUptime(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

GetUptime 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

func MonthlyEndpoint(filter bson.M) []bson.M

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

func MonthlyGroup(filter bson.M) []bson.M

MonthlyGroup query to aggregate monthly results from mongodb

func MonthlySuperGroup

func MonthlySuperGroup(filter bson.M) []bson.M

MonthlySuperGroup function to build the MongoDB aggregation query for monthly calculations

func Options

func Options(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

Types

type Availability

type Availability struct {
	Date         string `json:"date,omitempty"`
	Availability string `json:"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 GroupStatusData struct {
	Report           string `bson:"report"`
	Timestamp        string `bson:"timestamp"`
	Group            string `bson:"endpoint_group"`
	Status           string `bson:"status"`
	DateInteger      int    `bson:"date_integer"`
	HasThresholdRule bool   `bson:"has_threshold_rule"`
}

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"`
}

type StatusResult

type StatusResult struct {
	Timestamp               string `json:"timestamp"`
	Value                   string `json:"value"`
	AffectedByThresholdRule bool   `json:"affected_by_threshold_rule,omitempty"`
}

type Uptime

type Uptime struct {
	Date   string `json:"date,omitempty"`
	Uptime string `json:"uptime,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL