trace

package
v0.0.0-...-cbea63e Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Trace package facilitates the recording of trace events which allow us to follow a request right the way through the H2 platform

Trace package facilitates the recording of trace events which allow us to follow a request right the way through the H2 platform

Index

Constants

View Source
const (
	// Decreased from g2s limit of 64KB which seems a bit optimistic
	// If this size is a problem it could probably be increased
	// from 512B as its being sent to localhost
	MAX_PACKET_SIZE = 512 - 8 - 20 // 8-byte UDP header, 20-byte IP header
)

Variables

This section is empty.

Functions

func Send

func Send(e *traceproto.Event) error

Send will ping off a trace event

Types

type Phosphor

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

A Phosphor client is just something which has an io.Writer

func (*Phosphor) Close

func (p *Phosphor) Close() error

Close the UDP socket

func (*Phosphor) Publish

func (p *Phosphor) Publish(msg []byte)

Write trace to the connection as packets Make sure these are smaller than MAX_PACKET_SIZE We then write them into the io.Writer

type Tracer

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

func New

func New() *Tracer

New will mint a new Tracer - getting phosphor connection details from the config service and then looking out for any changes.

Jump to

Keyboard shortcuts

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