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" 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 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.