mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-14 17:44:06 -08:00
16 lines
418 B
Go
16 lines
418 B
Go
package marathon
|
|
|
|
import (
|
|
"fmt"
|
|
"math/rand"
|
|
)
|
|
|
|
const appListPath string = "/v2/apps/?embed=apps.tasks"
|
|
|
|
// RandomAppsURL randomly selects a server from an array and creates an URL pointing to the app list.
|
|
func RandomAppsURL(servers []string) string {
|
|
// TODO If possible update server list from Marathon at some point
|
|
server := servers[rand.Intn(len(servers))]
|
|
return fmt.Sprintf("%s%s", server, appListPath)
|
|
}
|