usageevents

package
v0.0.0-...-5a7770c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppDetails = cmap.New() //make(map[string]domain.App)
View Source
var OrganizationUsers = make(map[string][]cfclient.User)
View Source
var Orgs []cfclient.Org
View Source
var Spaces []cfclient.Space
View Source
var SpacesUsers = make(map[string][]cfclient.User)

Functions

func GetMapKeyFromAppData

func GetMapKeyFromAppData(orgName string, spaceName string, appName string) string

GetMapKeyFromAppData converts the combo of an app, space, and org into a hashmap key

func ProcessEvent

func ProcessEvent(msg *events.Envelope)

func ProcessEvents

func ProcessEvents(in <-chan *events.Envelope)

ProcessEvents churns through the firehose channel, processing incoming events.

func ReloadApps

func ReloadApps(cachedApps []caching.App, client apiClient)

ReloadApps responsilbe for refreshing apps in the cache

Types

type AppCache

type AppCache struct{}

AppCache allows retrieving information from the cache

func (*AppCache) GetAllApp

func (c *AppCache) GetAllApp() []caching.App

GetAllApp get all caching.App

func (*AppCache) GetAppByGUID

func (c *AppCache) GetAppByGUID(appGUID string) []caching.App

GetAppByGUID get Applications by guid

func (*AppCache) GetAppInfo

func (c *AppCache) GetAppInfo(appGUID string) caching.App

GetAppInfo get App by appGUID

type CachedApp

type CachedApp interface {
	GetAppByGUID(appGUID string) []caching.App
	GetAppInfo(appGUID string) caching.App
	GetAllApp() []caching.App
}

CachedApp interface for retrieving information from the cache

var AppDbCache CachedApp

type Event

type Event struct {
	Msg            string  `json:"message"`
	Type           string  `json:"event_type"`
	Origin         string  `json:"origin"`
	AppID          string  `json:"app_id"`
	Timestamp      int64   `json:"timestamp"`
	SourceType     string  `json:"source_type"`
	MessageType    string  `json:"message_type"`
	SourceInstance string  `json:"source_instance"`
	AppName        string  `json:"app_name"`
	OrgName        string  `json:"org_name"`
	SpaceName      string  `json:"space_name"`
	OrgID          string  `json:"org_id"`
	SpaceID        string  `json:"space_id"`
	CellIP         string  `json:"cell_ip"`
	InstanceIndex  int32   `json:"instance_index"`
	CPUPercentage  float64 `json:"cpu_percentage"`
	MemBytes       uint64  `json:"mem_bytes"`
	DiskBytes      uint64  `json:"disk_bytes"`
}

Event is a struct represented an event augmented/decorated with corresponding app/space/org data.

func ContainerMetric

func ContainerMetric(msg *events.Envelope) Event

func LogMessage

func LogMessage(msg *events.Envelope) Event

LogMessage augments a raw message Envelope with log message metadata.

func (*Event) AnnotateWithAppData

func (e *Event) AnnotateWithAppData()

AnnotateWithAppData adds application specific details to an event by looking up the GUID in the cache.

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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