reporter

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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