Documentation ¶
Index ¶
- func Sum(r []store.Rate) store.Rate
- type AppGUID
- type AppInfo
- type AppInfoStore
- type Authenticator
- type CachedAppInfoStore
- type CachedAppInfoStoreOption
- type Collector
- type CollectorOption
- type GUIDIndex
- type HTTPAppInfoStore
- type HTTPClient
- type V2Resource
- type V2Response
- type V3Relationship
- type V3Resource
- type V3Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppInfoStore ¶
AppInfoStore provides a way to find AppInfo for an app GUID.
type Authenticator ¶
Authenticator is used to refresh the authentication token.
type CachedAppInfoStore ¶
type CachedAppInfoStore struct {
// contains filtered or unexported fields
}
CachedAppInfoStore caches app info lookups against the APIStore.
func NewCachedAppInfoStore ¶
func NewCachedAppInfoStore(s AppInfoStore, opts ...CachedAppInfoStoreOption) *CachedAppInfoStore
NewCachedAppInfoStore initializes a CachedAppInfoStore.
type CachedAppInfoStoreOption ¶
type CachedAppInfoStoreOption func(*CachedAppInfoStore)
func WithCacheTTL ¶
func WithCacheTTL(cacheTTL time.Duration) CachedAppInfoStoreOption
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector handles fetch rates form multiple nozzles and summing their rates.
func New ¶
func New( nozzles []string, auth Authenticator, nozzleAppGUID string, store AppInfoStore, opts ...CollectorOption, ) *Collector
New initializes and returns a new Collector.
func (*Collector) BuildPoints ¶
BuildPoints satisfies the datadog PointBuilder interface. It will request all the rates from all the known nozzles and sum their counts.
type CollectorOption ¶
type CollectorOption func(c *Collector)
CollectorOption is a type of func that can be used for optional configuration settings for the Collector.
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) CollectorOption
WithHTTPClient sets the the http client that the collector will use to make calls to external services.
func WithReportLimit ¶
func WithReportLimit(n int) CollectorOption
WithReportLimit sets the limit of application instances to report to datadog. Example: If report limit is set to 100, only the 100 noisest application instances will be reported.
type GUIDIndex ¶
type GUIDIndex string
GUIDIndex is a concatentation of GUID and instance index in the format some-guid/some-index, e.g., 7b8228a0-cf40-42d8-a7bb-b287a88198a3/0
type HTTPAppInfoStore ¶
type HTTPAppInfoStore struct {
// contains filtered or unexported fields
}
HTTPAppInfoStore provides a focused source of Cloud Controller API data.
func NewHTTPAppInfoStore ¶
func NewHTTPAppInfoStore( apiAddr string, client HTTPClient, auth Authenticator, ) *HTTPAppInfoStore
NewHTTPAppInfoStore initializes an APIStore and sends all HTTP requests to the API URL specified by apiAddr.
type HTTPClient ¶
HTTPClient supports HTTP requests.
type V2Resource ¶
type V2Resource struct { Metadata struct { GUID string `json:"guid"` } `json:"metadata"` Entity struct { Name string `json:"name"` } `json:"entity"` }
V2Resource represents a single V2 API resource
type V2Response ¶
type V2Response struct {
Resources []V2Resource `json:"resources"`
}
V2Response represents a list of V2 API resources.
type V3Relationship ¶
type V3Relationship struct { Data struct { GUID string `json:"guid"` } `json:"data"` }
V3Relationship represents a V3 API resource relationship.
type V3Resource ¶
type V3Resource struct { GUID string `json:"guid"` Name string `json:"name"` Relationships map[string]V3Relationship `json:"relationships"` }
V3Resource represents application data returned from the Cloud Controller API.
type V3Response ¶
type V3Response struct {
Resources []V3Resource `json:"resources"`
}
V3Response represents a list of V3 API resources and associated data.