probe

package
v0.0.0-...-2875ce1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package probe implements an FCM probe that will:

Initialize a new emulator and target app
Send a specified number of messages to the app
Attempt to verify that the app received those messages
Log findings to Cloud Logger
Terminate emulator and target app when finished

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Control

func Control(mk utils.CommandMaker, clk utils.Timer, lg Logger)

Handles startup/teardown of emulator/app, also starts and stops probing

Types

type Auth

type Auth struct {
	Token     string        `json:"access_token"`
	Ttl       time.Duration `json:"expires_in,int"`
	TokenType string        `json:"token_type"`
	// contains filtered or unexported fields
}

Represents an authentication response, into which JSON can be parsed

type CloudLogger

type CloudLogger struct {
	Region    string // Region in which VM is located
	LogDest   string // Location in Cloud Logger where probes should be logged
	ErrorDest string // Location in Cloud Logger where errors should be logged
}

Logger that sends logs to cloud logger via gcloud

func NewCloudLogger

func NewCloudLogger() *CloudLogger

func (*CloudLogger) LogError

func (c *CloudLogger) LogError(desc string)

Log errors to specified log

func (*CloudLogger) LogErrorf

func (c *CloudLogger) LogErrorf(desc string, args ...interface{})

Log errors with format

func (*CloudLogger) LogFatal

func (c *CloudLogger) LogFatal(desc string)

Log error and terminate

func (*CloudLogger) LogFatalf

func (c *CloudLogger) LogFatalf(desc string, args ...interface{})

Log error with format and terminate

func (*CloudLogger) LogProbe

func (c *CloudLogger) LogProbe(sp *sentProbe, st string, lat int, tok string)

Log probe information to specified log

func (*CloudLogger) SetError

func (c *CloudLogger) SetError(dest string)

Set error log location

func (*CloudLogger) SetLog

func (c *CloudLogger) SetLog(dest string)

Set probe log location

func (*CloudLogger) SetRegion

func (c *CloudLogger) SetRegion(reg string)

Set the region in which VM is located

type Logger

type Logger interface {
	SetRegion(reg string)
	SetError(dest string)
	SetLog(dest string)
	LogProbe(sp *sentProbe, st string, lat int, tok string)
	LogError(desc string)
	LogErrorf(desc string, args ...interface{})
	LogFatal(desc string)
	LogFatalf(desc string, args ...interface{})
}

Wrapper for logging

Jump to

Keyboard shortcuts

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