Documentation ¶
Index ¶
- Constants
- func GetCRConfig(monitorFQDN string, client *http.Client) (tc.CRConfig, error)
- func GetCRStates(monitorFQDN string, client *http.Client) (tc.CRStates, error)
- func GetCacheStats(monitorFQDN string, client *http.Client, stats []string) (tc.Stats, string, error)
- func GetClient(tx *sql.Tx) (*http.Client, error)
- func GetLegacyCacheStats(monitorFQDN string, client *http.Client, stats []string) (tc.LegacyStats, string, error)
- func GetURLs(tx *sql.Tx) (map[tc.CDNName][]string, error)
- func UpgradeLegacyStats(legacyStats tc.LegacyStats) tc.Stats
Constants ¶
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 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 ¶
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 ¶
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.