chrome

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: NCSA Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDisplayTimeUnit = "ms"
)

Functions

func ConvertFile

func ConvertFile(path string) ([]byte, error)

func Marshal

func Marshal(trace model.Trace) ([]byte, error)

func NewTree

func NewTree(tr Trace) augmentedtree.Tree

Types

type EventFrame

type EventFrame struct {
	Name   string `json:"name"`
	Parent int    `json:"parent,omitempty"`
}

type Trace

type Trace struct {
	ID              string                `json:"id,omitempty"`
	StartTime       time.Time             `json:"start_time,omitempty"`
	EndTime         time.Time             `json:"end_time,omitempty"`
	TraceEvents     TraceEvents           `json:"traceEvents,omitempty"`
	DisplayTimeUnit string                `json:"displayTimeUnit,omitempty"`
	Frames          map[string]EventFrame `json:"stackFrames"`
	TimeUnit        string                `json:"timeUnit,omitempty"`
}

func Combine

func Combine(trace0 Trace, others ...Trace) *Trace

func Convert

func Convert(tr model.Trace) (*Trace, error)

func (Trace) AddDurationOffset

func (x Trace) AddDurationOffset(td time.Duration) Trace

func (Trace) AddTimestampOffset

func (x Trace) AddTimestampOffset(ts int64) Trace

func (Trace) Adjust

func (x Trace) Adjust() (Trace, error)

func (*Trace) Combine

func (tr *Trace) Combine(other Trace)

func (Trace) DeleteIgnoredEvents

func (x Trace) DeleteIgnoredEvents() (Trace, error)

func (Trace) HashID

func (x Trace) HashID() int64

func (Trace) Len

func (t Trace) Len() int

func (Trace) Less

func (t Trace) Less(i, j int) bool

func (Trace) MaxEvent

func (x Trace) MaxEvent() TraceEvent

func (Trace) MinEvent

func (x Trace) MinEvent() TraceEvent

func (Trace) Swap

func (t Trace) Swap(i, j int)

func (Trace) ZeroOut

func (x Trace) ZeroOut() Trace

type TraceEvent

type TraceEvent struct {
	Name      string                 `json:"name,omitempty"`
	EventType string                 `json:"ph"`
	Scope     string                 `json:"s,omitempty"`
	Timestamp float64                `json:"ts"`
	Duration  float64                `json:"dur,omitempty"`
	ProcessID uint64                 `json:"pid"`
	ThreadID  uint64                 `json:"tid"`
	SpanID    uint64                 `json:"id,omitempty"`
	Stack     int                    `json:"sf,omitempty"`
	EndStack  int                    `json:"esf,omitempty"`
	Arg       map[string]interface{} `json:"args,omitempty"`
	ColorName string                 `json:"cname,omitempty"`
	Category  string                 `json:"cat,omitempty"`

	Start     int64         `json:"start,omitempty"`
	End       int64         `json:"end,omitempty"`
	InitTime  time.Time     `json:"init_time_t,omitempty"`
	StartTime time.Time     `json:"start_time_t,omitempty"`
	EndTime   time.Time     `json:"end_time_t,omitempty"`
	Time      time.Time     `json:"time_t,omitempty"`
	TimeUnit  time.Duration `json:"timeUnit,omitempty"`
}

Trace is an entry of trace format. https://github.com/catapult-project/catapult/tree/master/tracing

func (TraceEvent) HighAtDimension

func (x TraceEvent) HighAtDimension(d uint64) int64

HighAtDimension returns an integer representing the higher bound at the requested dimension.

func (TraceEvent) ID

func (x TraceEvent) ID() uint64

ID should be a unique ID representing this interval. This is used to identify which interval to delete from the tree if there are duplicates.

func (TraceEvent) LowAtDimension

func (x TraceEvent) LowAtDimension(d uint64) int64

LowAtDimension returns an integer representing the lower bound at the requested dimension.

func (TraceEvent) OverlapsAtDimension

func (mi TraceEvent) OverlapsAtDimension(iv augmentedtree.Interval, dimension uint64) bool

OverlapsAtDimension should return a bool indicating if the provided interval overlaps this interval at the dimension requested.

type TraceEvents

type TraceEvents []TraceEvent

func (TraceEvents) Len

func (t TraceEvents) Len() int

func (TraceEvents) Less

func (t TraceEvents) Less(i, j int) bool

func (TraceEvents) Swap

func (t TraceEvents) Swap(i, j int)

Jump to

Keyboard shortcuts

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