reporter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUnsupportedCFDeploymentError

func NewUnsupportedCFDeploymentError(appName string) error

Types

type AppReporter

type AppReporter struct {
	// contains filtered or unexported fields
}

func NewAppReporter

func NewAppReporter(cfClient AppReporterCloudFoundryClient, currentUsageFetcher, lastSpikeFetcher, cumulativeUsageFetcher InstanceDataFetcher) AppReporter

func (AppReporter) CreateApplicationReport

func (r AppReporter) CreateApplicationReport(logger lager.Logger, appName string) (ApplicationReport, error)

type AppReporterCloudFoundryClient

type AppReporterCloudFoundryClient interface {
	GetApplication(logger lager.Logger, appName string) (cf.Application, error)
	GetCurrentOrg(logger lager.Logger) (string, error)
	GetCurrentSpace(logger lager.Logger) (string, error)
	Username(logger lager.Logger) (string, error)
}

type ApplicationReport

type ApplicationReport struct {
	Org             string
	Username        string
	Space           string
	ApplicationName string
	InstanceReports []InstanceReport
}

type CloudFoundryClient

type CloudFoundryClient interface {
	GetSpaces(logger lager.Logger) ([]cf.Space, error)
	GetCurrentOrg(logger lager.Logger) (string, error)
	Username(logger lager.Logger) (string, error)
}

type CumulativeUsage

type CumulativeUsage struct {
	Value float64
}

type CurrentUsage

type CurrentUsage struct {
	Value float64
}

type InstanceDataFetcher

type InstanceDataFetcher interface {
	FetchInstanceData(logger lager.Logger, appGUID string, appInstances map[int]cf.Instance) (map[int]interface{}, error)
}

type InstanceReport

type InstanceReport struct {
	InstanceID      int
	CumulativeUsage CumulativeUsage
	CurrentUsage    CurrentUsage
	LastSpike       LastSpike
}

type LastSpike

type LastSpike struct {
	From time.Time
	To   time.Time
}

type MetricsFetcher

type MetricsFetcher interface {
	FetchInstanceData(logger lager.Logger, appGuid string, appInstances map[int]cf.Instance) (map[int]interface{}, error)
}

type OEIReport

type OEIReport struct {
	Org          string
	Username     string
	SpaceReports []SpaceReport
}

type OverEntitlementInstances

type OverEntitlementInstances struct {
	// contains filtered or unexported fields
}

func NewOverEntitlementInstances

func NewOverEntitlementInstances(cf CloudFoundryClient, metricsFetcher MetricsFetcher) OverEntitlementInstances

func (OverEntitlementInstances) OverEntitlementInstances

func (r OverEntitlementInstances) OverEntitlementInstances(logger lager.Logger) (OEIReport, error)

type SpaceReport

type SpaceReport struct {
	SpaceName string
	Apps      []string
}

type UnsupportedCFDeploymentError

type UnsupportedCFDeploymentError struct {
	// contains filtered or unexported fields
}

func (UnsupportedCFDeploymentError) Error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL