Version: v0.0.0-...-ff5f600 Latest Latest

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

Go to latest
Published: Apr 30, 2016 License: BSD-3-Clause Imports: 12 Imported by: 0



Package vtrace implements the Trace and Span interfaces in v.io/v23/vtrace. We also provide internal utilities for migrating trace information across RPC calls.



This section is empty.


This section is empty.


func GetVTraceLevel

func GetVTraceLevel(ctx *context.T) int

SetVTraceLevel returns the vtrace level This value is used to determine which log messages are sent as part of the vtrace output.

func Init

func Init(ctx *context.T, opts flags.VtraceFlags) (*context.T, error)

Init initializes vtrace and attaches some state to the context. This should be called by the runtimes initialization function.


type Store

type Store struct {
	// contains filtered or unexported fields

Store implements a store for traces. The idea is to keep all the information we have about some subset of traces that pass through the server. For now we just implement an LRU cache, so the least recently started/finished/annotated traces expire after some maximum trace count is reached. TODO(mattr): LRU is the wrong policy in the long term, we should try to keep some diverse set of traces and allow users to specifically tell us to capture a specific trace. LRU will work OK for many testing scenarios and low volume applications.

func NewStore

func NewStore(opts flags.VtraceFlags) (*Store, error)

NewStore creates a new store according to the passed in opts.

func (*Store) ForceCollect

func (s *Store) ForceCollect(id uniqueid.Id, level int)

func (*Store) Merge

func (s *Store) Merge(t vtrace.Response)

Merge merges a vtrace.Response into the current store.

func (*Store) TraceRecord

func (s *Store) TraceRecord(id uniqueid.Id) *vtrace.TraceRecord

TraceRecord returns a TraceRecord for a given Id. Returns nil if the given id is not present.

func (*Store) TraceRecords

func (s *Store) TraceRecords() []vtrace.TraceRecord

TraceRecords returns TraceRecords for all traces saved in the store.

type VTraceLogger

type VTraceLogger struct{}

func (*VTraceLogger) InfoDepth

func (*VTraceLogger) InfoDepth(ctx *context.T, depth int, args ...interface{})

func (*VTraceLogger) InfoStack

func (*VTraceLogger) InfoStack(ctx *context.T, all bool)

func (*VTraceLogger) VDepth

func (*VTraceLogger) VDepth(ctx *context.T, depth int, level int) bool

func (*VTraceLogger) VIDepth

func (v *VTraceLogger) VIDepth(ctx *context.T, depth int, level int) context.ContextLogger

Jump to

Keyboard shortcuts

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