eventRoute

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const OTHER = "OTHER"

Used as an overflow key when too many values are in map E.g., if too many values in UserAgent map, use OTHER bucket

Variables

This section is empty.

Functions

This section is empty.

Types

type AppRouteSlice

type AppRouteSlice []*AppRouteStats

type AppRouteStats

type AppRouteStats struct {
	AppId string

	// E.g., GET, PUT, POST, DELETE
	HttpMethodStatsMap map[events.Method]*HttpMethodStats

	// Good idea??
	UserAgentMap map[string]int64
}

func NewAppRouteStats

func NewAppRouteStats(appId string) *AppRouteStats

func (*AppRouteStats) FindHttpMethodStats

func (ars *AppRouteStats) FindHttpMethodStats(httpMethod events.Method) *HttpMethodStats

type ByLength

type ByLength []string

func (ByLength) Len

func (s ByLength) Len() int

func (ByLength) Less

func (s ByLength) Less(i, j int) bool

func (ByLength) Swap

func (s ByLength) Swap(i, j int)

type DomainStats

type DomainStats struct {
	DomainId string
	// Key: host
	HostStatsMap map[string]*HostStats
}

Domain --> Host --> Path -> AppId = RouteStats

func NewDomainStats

func NewDomainStats(domainId string) *DomainStats

func (*DomainStats) Id

func (ds *DomainStats) Id() string

type HostSlice

type HostSlice []*HostStats

type HostStats

type HostStats struct {

	// Key: path (needs to include empty string as key for root path)
	RouteStatsMap map[string]*RouteStats

	// Key: tcp port (for TCP based routes)
	TcpRouteStatsMap map[int]*RouteStats
	// contains filtered or unexported fields
}

func NewHostStats

func NewHostStats(hostName string) *HostStats

func (*HostStats) AddPath

func (hs *HostStats) AddPath(path string, routeId string, ignoreOnExists bool) *RouteStats

func (*HostStats) AddPathDynamic

func (hs *HostStats) AddPathDynamic(fullPath string, routeId string) *RouteStats

func (*HostStats) AddPort

func (hs *HostStats) AddPort(port int, routeId string, ignoreOnExists bool) *RouteStats

func (*HostStats) FindPathMatch

func (hs *HostStats) FindPathMatch(findPath string) string

Find matching route for given path TODO: Are "path" definitions in CF case sensative?

[0] "/webappa/subapp1" [1] "/webappa" [2] ""

findPath = "/webappabc" => "" findPath = "/webappa" => "/webappa" findPath = "/webappa/" => "/webappa" findPath = "/webappa/doc" => "/webappa"

func (*HostStats) FindRouteStats

func (hs *HostStats) FindRouteStats(findPath string) *RouteStats

type HttpMethodSlice

type HttpMethodSlice []*HttpMethodStats

type HttpMethodStats

type HttpMethodStats struct {
	Method     events.Method
	LastAccess time.Time

	AvgResponseL60Time float64 // updated after a clone of this object
	EventL60Rate       int     // updated after a clone of this object

	AvgResponseL10Time float64 // updated after a clone of this object
	EventL10Rate       int     // updated after a clone of this object

	AvgResponseL1Time float64 // updated after a clone of this object
	EventL1Rate       int     // updated after a clone of this object

	RequestCount int64

	// E.g., 200, 404, 500
	HttpStatusCode map[int32]int64

	// NOTE: is this realistic?? There could be unlimited number of RemoteAddresses
	// PCF 1.6 - All we have it remoteAddresses
	// PCF 1.7 - All we have it remoteAddresses as format of uri is messed up
	// PCF 1.8: "forwarded" (array) - pick the first/top forwarded value from HttpStartStop event array
	// NOTE: PCF 1.8 - remote address includes a port
	Forwarder map[string]int64

	ResponseContentLength int64
	// Not currently used
	RequestContentLength int64
	// contains filtered or unexported fields
}

func NewHttpMethodStats

func NewHttpMethodStats(httpMethod events.Method) *HttpMethodStats

type RouteSlice

type RouteSlice []*RouteStats

type RouteStats

type RouteStats struct {
	RouteId string

	// Key: appId
	AppRouteStatsMap map[string]*AppRouteStats
}

func NewRouteStats

func NewRouteStats(routeId string) *RouteStats

func (*RouteStats) FindAppRouteStats

func (rs *RouteStats) FindAppRouteStats(appId string) *AppRouteStats

func (*RouteStats) Id

func (rs *RouteStats) Id() string

Jump to

Keyboard shortcuts

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