monitorhlp

package
v7.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 11 Imported by: 0

Documentation

Index

Constants

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

	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 a slice of Traffic Monitor FQDNs (including port numbers) of ONLINE monitors for each CDN. If a CDN has no online monitors, that CDN will not have an entry in the map.

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