Documentation ¶
Index ¶
- type Event
- type LocalTracer
- func (lt *LocalTracer) CopyTraceContext(src context.Context, dst context.Context) context.Context
- func (lt *LocalTracer) Emit(ctx context.Context, e trace.Event) (context.Context, error)
- func (lt *LocalTracer) Flush()
- func (lt *LocalTracer) Help() string
- func (lt *LocalTracer) Init(runID *taskdb.RunID) error
- func (lt *LocalTracer) ReadHTTPContext(ctx context.Context, header http.Header) context.Context
- func (lt *LocalTracer) URL(_ context.Context) string
- func (lt *LocalTracer) WriteHTTPContext(ctx context.Context, header *http.Header)
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Pid int `json:"pid"` Tid int `json:"tid"` Ts int64 `json:"ts"` Ph string `json:"ph"` Dur int64 `json:"dur,omitempty"` Name string `json:"name"` Cat string `json:"cat,omitempty"` Args map[string]interface{} `json:"args"` }
Event is an event in the Chrome tracing format. The fields are mirrored exactly from: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview Copied from: github.com/grailbio/bigslice/internal/trace/trace.go
type LocalTracer ¶
type LocalTracer struct {
// contains filtered or unexported fields
}
func New ¶
func New(path string) (*LocalTracer, error)
New returns a new LocalTracer instance. This function is intended for cases where Reflow is used as a library and the user would like to specify the path of the output trace file.
func (*LocalTracer) CopyTraceContext ¶
CopyTraceContext copies the trace context from src to dst and implements the trace.Tracer interface. Do not use directly, instead use trace.CopyTraceContext.
func (*LocalTracer) Emit ¶
Emit emits a trace event and implements the trace.Tracer interface. This should never be used directly, instead use trace.Start and trace.Note.
func (*LocalTracer) Flush ¶
func (lt *LocalTracer) Flush()
Flush writes the completed trace events to a file at lt.tracefilepath and can be called concurrently.
func (*LocalTracer) Init ¶
func (lt *LocalTracer) Init(runID *taskdb.RunID) error
Init implements infra.Provider and gets called when an instance of LocalTracer is created with infra.Config.Instance(...)
func (*LocalTracer) ReadHTTPContext ¶
ReadHTTPContext is not implemented for LocalTracer, this stub implements the trace.Tracer interface.
func (*LocalTracer) URL ¶
func (lt *LocalTracer) URL(_ context.Context) string
URL returns the location of the output trace file and implements the trace.Tracer interface. Do not use directly, instead use trace.URL.
func (*LocalTracer) WriteHTTPContext ¶
func (lt *LocalTracer) WriteHTTPContext(ctx context.Context, header *http.Header)
WriteHTTPContext is not implemented for LocalTracer, this stub implements the trace.Tracer interface.
type T ¶
type T struct {
Events []Event `json:"traceEvents"`
}
T represents the JSON object format in the Chrome tracing format. For more details, see: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview Copied from: github.com/grailbio/bigslice/internal/trace/trace.go