observer

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package observer provides clone monitoring.

Package observer provides clone monitoring.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CloneDir         string
	DataSubDir       string
	SocketDir        string
	ReplacementRules map[string]string `yaml:"replacementRules"`
}

Config defines configuration options for observer.

type Observer

type Observer struct {
	Platform *platform.Client
	// contains filtered or unexported fields
}

Observer manages observation sessions.

func NewObserver

func NewObserver(dockerClient *client.Client, cfg *Config, platform *platform.Client, pool *resources.Pool) *Observer

NewObserver creates an Observer instance.

func (*Observer) AddSession

func (o *Observer) AddSession(cloneID string, session *Session)

AddSession adds a new observation session to storage.

func (*Observer) GetCloneLog

func (o *Observer) GetCloneLog(ctx context.Context, port uint, session *Session) ([]byte, error)

GetCloneLog gets clone logs. TODO (akartasov): Split log to chunks.

func (*Observer) GetSession

func (o *Observer) GetSession(cloneID string) (*Session, error)

GetSession returns an observation session from storage.

func (*Observer) RemoveSession

func (o *Observer) RemoveSession(cloneID string)

RemoveSession removes an observation session from storage.

type ReplacementRule

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

ReplacementRule describes replacement rules.

type Session

type Session struct {
	SessionID  uint64            `json:"session_id"`
	StartedAt  time.Time         `json:"started_at"`
	FinishedAt time.Time         `json:"finished_at"`
	Config     types.Config      `json:"config"`
	Tags       map[string]string `json:"tags"`

	models.ObservationResult `json:"-"`
	// contains filtered or unexported fields
}

Session describes a session of service monitoring.

func NewSession

func NewSession(config types.Config) *Session

NewSession creates an Session instance.

func (*Session) CheckDuration

func (s *Session) CheckDuration() bool

CheckDuration checks duration of the operation.

func (*Session) CheckLocks

func (s *Session) CheckLocks() bool

CheckLocks checks long-lasting locks during the operation.

func (*Session) CheckPerformanceRequirements

func (s *Session) CheckPerformanceRequirements() error

CheckPerformanceRequirements checks monitoring data and returns an error if any of performance requires was not satisfied.

func (*Session) CsvFields

func (s *Session) CsvFields() string

CsvFields returns a comma-separated list of available csv fields.

func (*Session) PrintSummary

func (s *Session) PrintSummary() string

PrintSummary prints monitoring summary.

func (*Session) Start

func (s *Session) Start(clone *models.Clone) error

Start runs observation session.

func (*Session) Stop

func (s *Session) Stop()

Stop stops an observation session.

Jump to

Keyboard shortcuts

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