events

package
v1.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAppEventRecord

func CreateAppEventRecord(objectID, message, referenceID string, changeType si.EventRecord_ChangeType, changeDetail si.EventRecord_ChangeDetail, resource *resources.Resource) *si.EventRecord

func CreateNodeEventRecord

func CreateNodeEventRecord(objectID, message, referenceID string, changeType si.EventRecord_ChangeType, changeDetail si.EventRecord_ChangeDetail, resource *resources.Resource) *si.EventRecord

func CreateQueueEventRecord

func CreateQueueEventRecord(objectID, message, referenceID string, changeType si.EventRecord_ChangeType, changeDetail si.EventRecord_ChangeDetail, resource *resources.Resource) *si.EventRecord

func CreateRequestEventRecord

func CreateRequestEventRecord(objectID, referenceID, message string, resource *resources.Resource) *si.EventRecord

func Init added in v1.4.0

func Init()

VisibleForTesting

Types

type EventPublisher

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

func CreateShimPublisher

func CreateShimPublisher(store *EventStore) *EventPublisher

func (*EventPublisher) StartService

func (sp *EventPublisher) StartService()

func (*EventPublisher) Stop

func (sp *EventPublisher) Stop()

type EventStore

type EventStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

The EventStore operates under the following assumptions:

  • there is a cap for the number of events stored
  • the CollectEvents() function clears the currently stored events in the EventStore

Assuming the rate of events generated by the scheduler component in a given time period is high, calling CollectEvents() periodically should be fine.

func (*EventStore) CollectEvents

func (es *EventStore) CollectEvents() []*si.EventRecord

func (*EventStore) CountStoredEvents

func (es *EventStore) CountStoredEvents() int

func (*EventStore) Store

func (es *EventStore) Store(event *si.EventRecord)

type EventSystem added in v1.4.0

type EventSystem interface {
	AddEvent(event *si.EventRecord)
	StartService()
	Stop()
	IsEventTrackingEnabled() bool
	GetEventsFromID(uint64, uint64) ([]*si.EventRecord, uint64, uint64)
}

func GetEventSystem added in v1.4.0

func GetEventSystem() EventSystem

type EventSystemImpl added in v1.4.0

type EventSystemImpl struct {
	Store *EventStore // storing eventChannel

	sync.RWMutex
	// contains filtered or unexported fields
}

func (*EventSystemImpl) AddEvent added in v1.4.0

func (ec *EventSystemImpl) AddEvent(event *si.EventRecord)

func (*EventSystemImpl) GetEventsFromID added in v1.4.0

func (ec *EventSystemImpl) GetEventsFromID(id, count uint64) ([]*si.EventRecord, uint64, uint64)

func (*EventSystemImpl) GetRequestCapacity added in v1.4.0

func (ec *EventSystemImpl) GetRequestCapacity() int

func (*EventSystemImpl) GetRingBufferCapacity added in v1.4.0

func (ec *EventSystemImpl) GetRingBufferCapacity() uint64

func (*EventSystemImpl) IsEventTrackingEnabled added in v1.4.0

func (ec *EventSystemImpl) IsEventTrackingEnabled() bool

func (*EventSystemImpl) Restart added in v1.4.0

func (ec *EventSystemImpl) Restart()

func (*EventSystemImpl) StartService added in v1.4.0

func (ec *EventSystemImpl) StartService()

func (*EventSystemImpl) StartServiceWithPublisher added in v1.4.0

func (ec *EventSystemImpl) StartServiceWithPublisher(withPublisher bool)

func (*EventSystemImpl) Stop added in v1.4.0

func (ec *EventSystemImpl) Stop()

Jump to

Keyboard shortcuts

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