Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CumulativeInstanceData ¶
type CumulativeUsageFetcher ¶
type CumulativeUsageFetcher struct {
// contains filtered or unexported fields
}
func NewCumulativeUsageFetcher ¶
func NewCumulativeUsageFetcher(logCacheClient LogCacheClient) CumulativeUsageFetcher
func (CumulativeUsageFetcher) FetchInstanceData ¶
type CurrentInstanceData ¶
type CurrentUsageFetcher ¶
type CurrentUsageFetcher struct {
// contains filtered or unexported fields
}
func NewCurrentUsageFetcher ¶
func NewCurrentUsageFetcher(client LogCacheClient) CurrentUsageFetcher
func NewCurrentUsageFetcherWithFallbackFetcher ¶
func NewCurrentUsageFetcherWithFallbackFetcher(client LogCacheClient, fallbackFetcher Fetcher) CurrentUsageFetcher
func (CurrentUsageFetcher) FetchInstanceData ¶
type LastSpikeFetcher ¶
type LastSpikeFetcher struct {
// contains filtered or unexported fields
}
func NewLastSpikeFetcher ¶
func NewLastSpikeFetcher(client LogCacheClient, since time.Time) *LastSpikeFetcher
func (LastSpikeFetcher) FetchInstanceData ¶
type LastSpikeInstanceData ¶
type LogCacheClient ¶
type LogCacheClient interface { Read(ctx context.Context, sourceID string, start time.Time, opts ...logcache.ReadOption) ([]*loggregator_v2.Envelope, error) PromQL(ctx context.Context, query string, opts ...logcache.PromQLOption) (*logcache_v1.PromQL_InstantQueryResult, error) PromQLRange(ctx context.Context, query string, opts ...logcache.PromQLOption) (*logcache_v1.PromQL_RangeQueryResult, error) }
type ProcessInstanceIDFetcher ¶
type ProcessInstanceIDFetcher struct {
// contains filtered or unexported fields
}
func NewProcessInstanceIDFetcher ¶
func NewProcessInstanceIDFetcher(client LogCacheClient) ProcessInstanceIDFetcher
func NewProcessInstanceIDFetcherWithLimit ¶
func NewProcessInstanceIDFetcherWithLimit(client LogCacheClient, limit int) ProcessInstanceIDFetcher
func (ProcessInstanceIDFetcher) Fetch ¶
func (f ProcessInstanceIDFetcher) Fetch(logger lager.Logger, appGUID string) (map[int]string, error)
Fetch searches in a 30s interval, in which each app instance will have emitted at least one metric. As log-cache read is limited to 1000 results, we have implemented some pagination here. We start with the topmost 1000 results, and if we do receive 1000 back, there may be more, so we reduce `end` back to the timestamp of the earliest metric from the results and re-read. As soon as fewer than 1000 results are returned we stop, as we have exhausted the range. We also apply a 10 iteration sanity check to avoid looping forever.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.