Пример #1
0
// MaxNsqdConnHealthCheck asserts that the total number of established tcp connections to all nsqd's fall
// below a given max threshold.
func MaxNsqdConnHealthCheck(maxconns int) healthcheck.Checker {
	return func() (map[string]string, error) {
		pubHosts := getHosts(4150, "hailo", "service", "nsq", "pubHosts")
		subHosts := getHosts(4150, "hailo", "service", "nsq", "subHosts")
		return connhealthcheck.MaxTcpConnections(append(pubHosts, subHosts...), maxconns)()
	}
}
Пример #2
0
// MaxConnHealthCheck asserts that the total number of established connections to all cassandra nodes
// falls below a given max threshold.
func MaxConnHealthCheck(maxconns int) healthcheck.Checker {
	return func() (map[string]string, error) {
		return connhealthcheck.MaxTcpConnections(getHosts(), maxconns)()
	}
}
Пример #3
0
// MaxConnHealthCheck asserts that the total number of established connections to all zookeeper nodes
// falls below a given max threshold.
func MaxConnHealthCheck(maxconns int) healthcheck.Checker {
	return func() (map[string]string, error) {
		nodes := config.AtPath("hailo", "service", "zookeeper", "hosts").AsHostnameArray(2181)
		return connhealthcheck.MaxTcpConnections(nodes, maxconns)()
	}
}