fact

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AWS Platform = "AWS" // AWS Lambda
	ICF          = "ICF" // IBM Cloud Functions
	GCF          = "GCF" // Google Cloud Functions
	ACF          = "ACF" // Microsoft Azure Cloud Functions
	OW           = "OW"  // OpenWhisk
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVWriter

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

func (*CSVWriter) Name

func (c *CSVWriter) Name() string

func (*CSVWriter) Open

func (c *CSVWriter) Open(writer io.Writer, append bool)

func (*CSVWriter) Write

func (c *CSVWriter) Write(traces []*Trace) error

CSV Writer will not output Logs or Args

type Platform

type Platform string

type ResultCollector

type ResultCollector struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector() *ResultCollector

func (*ResultCollector) Add

func (c *ResultCollector) Add(t *Trace)

func (*ResultCollector) AddObserver

func (c *ResultCollector) AddObserver(observer TraceObserver)

func (*ResultCollector) Close

func (c *ResultCollector) Close()

func (*ResultCollector) Decode

func (c *ResultCollector) Decode(reader io.Reader) error

func (*ResultCollector) GetTraces

func (c *ResultCollector) GetTraces() []*Trace

func (*ResultCollector) Write

func (c *ResultCollector) Write(writer TraceWriter) error

Write merges and writes all collected traces to the provider provider. Warning! This action will delete all collected traces after successful write operations.

type TCPCollector

type TCPCollector struct {
	*ResultCollector
	// contains filtered or unexported fields
}

func NewTCPCollector

func NewTCPCollector(port, worker, maxConnections int) *TCPCollector

func (*TCPCollector) Close

func (t *TCPCollector) Close()

func (*TCPCollector) Listen

func (t *TCPCollector) Listen()

type Trace

type Trace struct {
	//unique identifier of this trace
	ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	//a reference to the invoking function, can be empty
	ChildOf string `protobuf:"bytes,2,opt,name=ChildOf,proto3" json:"ChildOf,omitempty"`
	//time this trace was created
	Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"`
	//unique identifier of the computation runtime
	ContainerID string `protobuf:"bytes,4,opt,name=ContainerID,proto3" json:"ContainerID,omitempty"`
	//unique identifier for the computation host
	HostID string `protobuf:"bytes,5,opt,name=HostID,proto3" json:"HostID,omitempty"`
	//the first time the computation runtime was started
	BootTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=BootTime,proto3" json:"BootTime,omitempty"`
	//cost for the execution
	Cost float32 `protobuf:"fixed32,7,opt,name=Cost,proto3" json:"Cost,omitempty"`
	//time the request started (sending of first byte)
	RequestStartTime *timestamp.Timestamp `protobuf:"bytes,21,opt,name=RequestStartTime,proto3" json:"RequestStartTime,omitempty"`
	//time the execution started
	StartTime *timestamp.Timestamp `protobuf:"bytes,8,opt,name=StartTime,proto3" json:"StartTime,omitempty"`
	//return status, analogous to http status codes
	Status int32 `protobuf:"varint,9,opt,name=Status,proto3" json:"Status,omitempty"`
	//time the execution completed
	EndTime *timestamp.Timestamp `protobuf:"bytes,10,opt,name=EndTime,proto3" json:"EndTime,omitempty"`
	//time the first byte of the request is received
	RequestEndTime *timestamp.Timestamp `protobuf:"bytes,22,opt,name=RequestEndTime,proto3" json:"RequestEndTime,omitempty"`
	//unique version of the deployed artefact (should increase only for code change)
	CodeVersion string `protobuf:"bytes,25,opt,name=CodeVersion,proto3" json:"CodeVersion,omitempty"`
	//unique version of the deployed configuration (should change if part of the direct configuration is changed)
	ConfigVersion string `protobuf:"bytes,26,opt,name=ConfigVersion,proto3" json:"ConfigVersion,omitempty"`
	//platform identifier
	Platform string `protobuf:"bytes,11,opt,name=Platform,proto3" json:"Platform,omitempty"`
	//region identifier
	Region string `protobuf:"bytes,12,opt,name=Region,proto3" json:"Region,omitempty"`
	//runtime identifier, including a version
	Runtime string `protobuf:"bytes,13,opt,name=Runtime,proto3" json:"Runtime,omitempty"`
	//configured available memory
	Memory int32 `protobuf:"varint,14,opt,name=Memory,proto3" json:"Memory,omitempty"`
	//Time before an execution
	ExecutionDelay *duration.Duration `protobuf:"bytes,23,opt,name=ExecutionDelay,proto3" json:"ExecutionDelay,omitempty"`
	//duration of execution
	ExecutionLatency *duration.Duration `protobuf:"bytes,15,opt,name=ExecutionLatency,proto3" json:"ExecutionLatency,omitempty"`
	//time until the result is send to the receiver
	TransportDelay *duration.Duration `protobuf:"bytes,24,opt,name=TransportDelay,proto3" json:"TransportDelay,omitempty"`
	//duration from sending the request until receiving the last byte of the request
	RequestResponseLatency *duration.Duration `protobuf:"bytes,20,opt,name=RequestResponseLatency,proto3" json:"RequestResponseLatency,omitempty"`
	//map of set enviroment variables. CAUTION, this can contain senstive information only populate if necessary!
	Env map[string]string `` /* 148-byte string literal not displayed */
	//flexible set of tags than can be used as a ad-hoc extension (will be ignored by most collectors)
	Tags map[string]string `` /* 150-byte string literal not displayed */
	//logs that can be set during execution. CAUTION use sparingly as it increase the size of the trace
	Logs map[uint64]string `` /* 151-byte string literal not displayed */
	//strings that can be added to the trace, useful to collect execution results. CAUTION use sparingly as it increase the size of the trace
	Args                 []string `protobuf:"bytes,19,rep,name=Args,proto3" json:"Args,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewTrace

func NewTrace() Trace

func (*Trace) Descriptor

func (*Trace) Descriptor() ([]byte, []int)

func (*Trace) GetArgs

func (m *Trace) GetArgs() []string

func (*Trace) GetBootTime

func (m *Trace) GetBootTime() *timestamp.Timestamp

func (*Trace) GetChildOf

func (m *Trace) GetChildOf() string

func (*Trace) GetCodeVersion

func (m *Trace) GetCodeVersion() string

func (*Trace) GetConfigVersion

func (m *Trace) GetConfigVersion() string

func (*Trace) GetContainerID

func (m *Trace) GetContainerID() string

func (*Trace) GetCost

func (m *Trace) GetCost() float32

func (*Trace) GetEndTime

func (m *Trace) GetEndTime() *timestamp.Timestamp

func (*Trace) GetEnv

func (m *Trace) GetEnv() map[string]string

func (*Trace) GetExecutionDelay

func (m *Trace) GetExecutionDelay() *duration.Duration

func (*Trace) GetExecutionLatency

func (m *Trace) GetExecutionLatency() *duration.Duration

func (*Trace) GetHostID

func (m *Trace) GetHostID() string

func (*Trace) GetID

func (m *Trace) GetID() string

func (*Trace) GetLogs

func (m *Trace) GetLogs() map[uint64]string

func (*Trace) GetMemory

func (m *Trace) GetMemory() int32

func (*Trace) GetPlatform

func (m *Trace) GetPlatform() string

func (*Trace) GetRegion

func (m *Trace) GetRegion() string

func (*Trace) GetRequestEndTime

func (m *Trace) GetRequestEndTime() *timestamp.Timestamp

func (*Trace) GetRequestResponseLatency

func (m *Trace) GetRequestResponseLatency() *duration.Duration

func (*Trace) GetRequestStartTime

func (m *Trace) GetRequestStartTime() *timestamp.Timestamp

func (*Trace) GetRuntime

func (m *Trace) GetRuntime() string

func (*Trace) GetStartTime

func (m *Trace) GetStartTime() *timestamp.Timestamp

func (*Trace) GetStatus

func (m *Trace) GetStatus() int32

func (*Trace) GetTags

func (m *Trace) GetTags() map[string]string

func (*Trace) GetTimestamp

func (m *Trace) GetTimestamp() *timestamp.Timestamp

func (*Trace) GetTransportDelay

func (m *Trace) GetTransportDelay() *duration.Duration

func (*Trace) Merge

func (t *Trace) Merge(partial *Trace) error

merge a partial trace with the same TraceID to this trace. Older timestamps have precidence.

func (*Trace) ProtoMessage

func (*Trace) ProtoMessage()

func (*Trace) Reset

func (m *Trace) Reset()

func (*Trace) String

func (m *Trace) String() string

func (*Trace) XXX_DiscardUnknown

func (m *Trace) XXX_DiscardUnknown()

func (*Trace) XXX_Marshal

func (m *Trace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Trace) XXX_Merge

func (m *Trace) XXX_Merge(src proto.Message)

func (*Trace) XXX_Size

func (m *Trace) XXX_Size() int

func (*Trace) XXX_Unmarshal

func (m *Trace) XXX_Unmarshal(b []byte) error

type TraceObserver

type TraceObserver interface {
	Observe(trace *Trace) //
	Close()
}

type TraceWriter

type TraceWriter interface {
	Name() string         //name of the writer, for ui purposes
	Open(io.Writer, bool) //attaches an io.writer used to write all traces to
	Write([]*Trace) error //writes the contens of a ResultCollector
}

func NewCSVWriter

func NewCSVWriter() TraceWriter

Jump to

Keyboard shortcuts

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