scheduler_service

package
v0.0.0-...-5ae6e0f Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package scheduler_service implements the code for query the scheduler service in other nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetApiUrl

func GetApiUrl(host string) string

func GetLeastLoadedMachineOfNRandom

func GetLeastLoadedMachineOfNRandom(n uint, currentLoad uint, checkQueues bool) (string, float64, error)

getLeastLoadedMachine retrieves the least loaded machine from an array of ips, if all machines are full loaded, the least queue is returned, and if there is no less loaded queue than us, an error is returned. This function returns (ip, mean_probing_time, errors)

func GetMonitoringLoadUrl

func GetMonitoringLoadUrl(host string) string

func GetPeerFunctionUrl

func GetPeerFunctionUrl(host string, functionName string) string

Types

type APIResponse

type APIResponse struct {
	Headers    http.Header
	Body       []byte
	StatusCode int
}

func ExecuteFunction

func ExecuteFunction(host string, request *types.PeerJobRequest) (*APIResponse, error)

ExecuteFunction allows to request another machine to execute a function

func GetLoad

func GetLoad(host string) (int, *APIResponse, error)

GetLoad allows to get the load of another machine, from a machine

type NoLessLoadedMachine

type NoLessLoadedMachine struct {
	Reason string
}

func (NoLessLoadedMachine) Error

func (n NoLessLoadedMachine) Error() string

Jump to

Keyboard shortcuts

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