supervisord

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Overview

Package supervisord provides facilities for working with Supervisord.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logs

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

Logs is responsible for interactions with logs.

func NewLogs

func NewLogs(pmmVersion string) *Logs

NewLogs creates a new Logs service. n is a number of last lines of log to read.

func (*Logs) Zip

func (l *Logs) Zip(ctx context.Context, w io.Writer) error

Zip creates .zip archive with all logs.

type Service

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

Service is responsible for interactions with Supervisord via supervisorctl.

func New

func New(configDir string) *Service

New creates new service.

func (*Service) ForceCheckUpdates

func (s *Service) ForceCheckUpdates() error

ForceCheckUpdates forces check for PMM updates. Result can be obtained via LastCheckUpdatesResult.

func (*Service) InstalledPMMVersion

func (s *Service) InstalledPMMVersion() *version.PackageInfo

InstalledPMMVersion returns currently installed PMM version information.

func (*Service) LastCheckUpdatesResult

func (s *Service) LastCheckUpdatesResult() (*version.UpdateCheckResult, time.Time)

LastCheckUpdatesResult returns last PMM update check result and last check time.

func (*Service) Run

func (s *Service) Run(ctx context.Context)

Run reads supervisord's log (maintail) and sends events to subscribers.

func (*Service) StartUpdate

func (s *Service) StartUpdate() (uint32, error)

StartUpdate starts pmm-update-perform supervisord program with some preparations. It returns initial log file offset.

func (*Service) UpdateConfiguration

func (s *Service) UpdateConfiguration(settings *models.Settings) error

UpdateConfiguration updates Prometheus and qan-api2 configurations, restarting them if needed.

func (*Service) UpdateLog

func (s *Service) UpdateLog(offset uint32) ([]string, uint32, error)

UpdateLog returns some lines and a new offset from pmm-update-perform log starting from the given offset. It may return zero lines and the same offset. Caller is expected to handle this.

func (*Service) UpdateRunning

func (s *Service) UpdateRunning() bool

UpdateRunning returns true if pmm-update-perform supervisord program is running or being restarted, false if it is not running / failed.

Jump to

Keyboard shortcuts

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