From 2fa91450df792689c42bd52f98ffdacee99ace91 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 30 Nov 2017 17:14:18 +0100 Subject: dashboard/app: add manager monitoring Make it possible to monitor health and operation of all managers from dashboard. 1. Notify dashboard about internal syz-ci errors (currently we don't know when/if they happen). 2. Send statistics from managers to dashboard. --- vm/vm.go | 9 +++------ vm/vmimpl/vmimpl.go | 4 ++++ 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'vm') diff --git a/vm/vm.go b/vm/vm.go index 48b68d597..519859a5e 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -37,18 +37,15 @@ type Instance struct { index int } -type ( - Env vmimpl.Env - BootError vmimpl.BootError -) +type Env vmimpl.Env var ( Shutdown = vmimpl.Shutdown TimeoutErr = vmimpl.TimeoutErr ) -func (err BootError) Error() string { - return fmt.Sprintf("%v\n%s", err.Title, err.Output) +type BootErrorer interface { + BootError() (string, []byte) } func Create(typ string, env *Env) (*Pool, error) { diff --git a/vm/vmimpl/vmimpl.go b/vm/vmimpl/vmimpl.go index 81f798d26..2e3833d89 100644 --- a/vm/vmimpl/vmimpl.go +++ b/vm/vmimpl/vmimpl.go @@ -66,6 +66,10 @@ func (err BootError) Error() string { return fmt.Sprintf("%v\n%s", err.Title, err.Output) } +func (err BootError) BootError() (string, []byte) { + return err.Title, err.Output +} + // Create creates a VM type that can be used to create individual VMs. func Create(typ string, env *Env) (Pool, error) { ctor := ctors[typ] -- cgit mrf-deployment