monitorhlp

package
v5.1.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 11 Imported by: 15

Documentation

Index

Constants

View Source
const (
	MonitorProxyParameter = "tm.traffic_mon_fwd_proxy"
	MonitorRequestTimeout = time.Second * 10
	MonitorOnlineStatus   = "ONLINE"

	TrafficMonitorCacheStatsPath       = "/publish/CacheStatsNew"
	TrafficMonitorLegacyCacheStatsPath = "/publish/CacheStats"
)

Variables

This section is empty.

Functions

func GetCRConfig

func GetCRConfig(monitorFQDN string, client *http.Client) (tc.CRConfig, error)

func GetCRStates

func GetCRStates(monitorFQDN string, client *http.Client) (tc.CRStates, error)

func GetCacheStats

func GetCacheStats(monitorFQDN string, client *http.Client, stats []string) (tc.Stats, string, error)

GetCacheStats gets the cache stats from the given monitor. The stats parameters is which stats to get; if stats is empty or nil, all stats are fetched.

func GetClient

func GetClient(tx *sql.Tx) (*http.Client, error)

GetClient returns the http.Client for making requests to the Traffic Monitor. This should always be used, rather than creating a default http.Client, to ensure any monitor forward proxy parameter is used correctly.

func GetLegacyCacheStats

func GetLegacyCacheStats(monitorFQDN string, client *http.Client, stats []string) (tc.LegacyStats, string, error)

GetLegacyCacheStats gets the pre ATCv5.0 cache stats from the given monitor. The stats parameters is which stats to get; if stats is empty or nil, all stats are fetched.

func GetURLs

func GetURLs(tx *sql.Tx) (map[tc.CDNName]string, error)

GetURLs returns an FQDN, including port, of an online monitor for each CDN. If a CDN has no online monitors, that CDN will not have an entry in the map. If a CDN has multiple online monitors, an arbitrary one will be returned.

func UpgradeLegacyStats

func UpgradeLegacyStats(legacyStats tc.LegacyStats) tc.Stats

UpgradeLegacyStats will take LegacyStats and transform them to Stats. It assumes all stats that go in Stats.Caches[cacheName] exist in Stats and not Interfaces

Types

This section is empty.

Jump to

Keyboard shortcuts

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