daemon

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorSystem

type ActorSystem struct {
	system.Support
	Storage string
	Metrics *Metrics
}

ActorSystem represents actor system subroutine

func NewActorSystem

func NewActorSystem(ctx context.Context, cfg config.Configuration, metrics *Metrics) ActorSystem

NewActorSystem returns actor system fascade

type Metrics

type Metrics struct {
	Support
	// contains filtered or unexported fields
}

Metrics represents metrics subroutine

func NewMetrics

func NewMetrics(ctx context.Context, cfg config.Configuration) Metrics

NewMetrics returns metrics fascade

func (Metrics) AccountCreated

func (metrics Metrics) AccountCreated()

AccountCreated increments account created by one

func (Metrics) CommitAccepted

func (metrics Metrics) CommitAccepted()

CommitAccepted increments accepted commits by one

func (Metrics) PromiseAccepted

func (metrics Metrics) PromiseAccepted()

PromiseAccepted increments accepted promises by one

func (Metrics) RollbackAccepted

func (metrics Metrics) RollbackAccepted()

RollbackAccepted increments accepted rollbacks by one

func (Metrics) SnapshotsUpdated

func (metrics Metrics) SnapshotsUpdated(count int64)

SnapshotsUpdated increments updated snapshots by given count

func (Metrics) Start

func (metrics Metrics) Start()

Start handles everything needed to start metrics daemon

func (Metrics) TimeUpdateSaturatedSnapshots

func (metrics Metrics) TimeUpdateSaturatedSnapshots(f func())

TimeUpdateSaturatedSnapshots measures time of SaturatedSnapshots function run

type Snapshot

type Snapshot struct {
	SnapshotCronLatency float64 `json:"snapshotCronLatency"`
	UpdatedSnapshots    int64   `json:"updatedSnapshots"`
	CreatedAccounts     int64   `json:"createdAccounts"`
	PromisesAccepted    int64   `json:"promisesAccepted"`
	CommitsAccepted     int64   `json:"commitsAccepted"`
	RollbacksAccepted   int64   `json:"rollbacksAccepted"`
}

Snapshot holds metrics snapshot status

func NewSnapshot

func NewSnapshot(metrics Metrics) Snapshot

NewSnapshot returns metrics snapshot

type SnapshotUpdater

type SnapshotUpdater struct {
	Support
	// contains filtered or unexported fields
}

SnapshotUpdater represents journal saturation update subroutine

func NewSnapshotUpdater

func NewSnapshotUpdater(ctx context.Context, cfg config.Configuration, metrics *Metrics, callback func(msg interface{}, to system.Coordinates, from system.Coordinates)) SnapshotUpdater

NewSnapshotUpdater returns snapshot updater fascade

func (SnapshotUpdater) Start

func (updater SnapshotUpdater) Start()

Start handles everything needed to start snapshot updater daemon it runs scan of accounts snapshots and events and orders accounts to update their snapshot if number of events in given version is larger than threshold

type Support

type Support struct {
	IsReady chan interface{}
	// contains filtered or unexported fields
}

Support provides support for graceful shutdown

func NewDaemonSupport

func NewDaemonSupport(parentCtx context.Context) Support

NewDaemonSupport constructor

func (Support) Done

func (s Support) Done() <-chan struct{}

Done cancel channel

func (Support) MarkDone

func (s Support) MarkDone()

MarkDone signals daemon is finished

func (Support) MarkReady

func (s Support) MarkReady()

MarkReady signals daemon is ready

func (Support) Start

func (s Support) Start()

Start daemon and wait for it to be ready

func (Support) Stop

func (s Support) Stop()

Stop daemon and wait for graceful shutdown

Jump to

Keyboard shortcuts

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