localdebug

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSpan

func NewSpan(name string) platform.Span

NewSpan creates span data

Types

type Client

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

Client is struct of local debugging client for tracing.

func NewClient

func NewClient(conf Config) *Client

NewClient returns initialized *Client.

func (*Client) Close added in v0.1.1

func (*Client) Close()

Close is dummy method.

func (*Client) Flush added in v0.1.1

func (*Client) Flush()

Flush is dummy method.

func (*Client) NewTrace

func (c *Client) NewTrace(ctx context.Context) (platform.Trace, error)

type Config

type Config struct {
	Logger *log.Logger
}

type Span

type Span struct {
	Name      string
	StartTime time.Time
	EndTime   time.Time

	SQL   string
	Error string
	// contains filtered or unexported fields
}

Span is wrapper struct of xray.Segment.

func (*Span) CanGetSummary

func (s *Span) CanGetSummary() bool

CanGetSummary determines Span can call GetSummary().

func (*Span) Finish

func (s *Span) Finish()

Finish save end time.

func (*Span) FinishWait

func (s *Span) FinishWait()

FinishWait save end time. (dummy method)

func (*Span) GetSummary

func (s *Span) GetSummary() []string

GetSummary returns trace duration data.

func (*Span) NewChild

func (s *Span) NewChild(name string) platform.Span

NewChild creates child span data from this Span.

func (*Span) OutputSummary

func (s *Span) OutputSummary()

OutputSummary print trace duration data.

func (*Span) SetEnvironment

func (s *Span) SetEnvironment(_ string) platform.Span

SetEnvironment is dummy method.

func (*Span) SetError

func (s *Span) SetError(err error) platform.Span

SetError sets error data into span.

func (*Span) SetLabel

func (s *Span) SetLabel(_, _ string) platform.Span

SetLabel is dummy method.

func (*Span) SetResponse

func (s *Span) SetResponse(status int) platform.Span

SetResponse is dummy method.

func (*Span) SetSQL

func (s *Span) SetSQL(sql string) platform.Span

SetSQL sets SQL query data into span.

func (*Span) SetServiceName

func (s *Span) SetServiceName(_ string) platform.Span

SetServiceName is dummy method.

func (*Span) SetUser

func (s *Span) SetUser(user string) platform.Span

SetUser is dummy method.

func (*Span) SetVersion

func (s *Span) SetVersion(_ string) platform.Span

SetVersion is dummy method.

func (*Span) TraceID

func (s *Span) TraceID() string

TraceID is dummy method.

type Trace

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

Trace is wrapper struct of AWS X-Ray *xray.XRay

func (*Trace) NewSpan

func (t *Trace) NewSpan(name string) platform.Span

NewSpan returns initialized span data with name.

func (*Trace) NewSpanFromRequest

func (t *Trace) NewSpanFromRequest(r *http.Request) platform.Span

NewSpanFromRequest returns initialized span data with *http.Request.

Jump to

Keyboard shortcuts

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