Documentation ¶
Index ¶
- Variables
- func NewTree(tr Trace) augmentedtree.Tree
- type EventFrame
- type GitInfo
- type JSONTrace
- type JSONTraceEvent
- type MemoryInformation
- type Trace
- func (x Trace) AddDurationOffset(td time.Duration) Trace
- func (x Trace) AddTimestampOffset(ts int64) Trace
- func (x Trace) Adjust() (Trace, error)
- func (tr *Trace) Combine(other Trace)
- func (x Trace) DeleteIgnoredEvents() (Trace, error)
- func (Trace) HTMLTemplate() string
- func (x Trace) HashID() int64
- func (t Trace) Len() int
- func (t Trace) Less(i, j int) bool
- func (x Trace) MaxEvent() TraceEvent
- func (x Trace) MinEvent() TraceEvent
- func (x Trace) Summarize(isFull bool) (*TraceSummary, error)
- func (t Trace) Swap(i, j int)
- func (x *Trace) UnmarshalJSON(data []byte) error
- func (tr Trace) UpdateEventNames() Trace
- func (tr Trace) Upload() error
- func (x Trace) ZeroOut() Trace
- type TraceEvent
- func (x TraceEvent) HighAtDimension(d uint64) int64
- func (x TraceEvent) ID() uint64
- func (x TraceEvent) LowAtDimension(d uint64) int64
- func (mi TraceEvent) OverlapsAtDimension(iv augmentedtree.Interval, dimension uint64) bool
- func (x TraceEvent) Summarize() *TraceSummaryEvent
- func (x *TraceEvent) UnmarshalJSON(data []byte) error
- type TraceEvents
- type TraceOtherData
- type TraceServerInfo
- type TraceSummary
- type TraceSummaryEvent
- type TraceSummaryEvents
Constants ¶
This section is empty.
Variables ¶
var (
DefaultDisplayTimeUnit = "ms"
)
Functions ¶
func NewTree ¶
func NewTree(tr Trace) augmentedtree.Tree
Types ¶
type EventFrame ¶
type JSONTrace ¶
type JSONTrace struct { ID string `json:"id,omitempty"` UPREnabled bool `json:"upr_enabled,omitempty"` TraceEvents TraceEvents `json:"traceEvents,omitempty"` DisplayTimeUnit string `json:"displayTimeUnit,omitempty"` Frames map[string]EventFrame `json:"stackFrames"` TimeUnit string `json:"timeUnit,omitempty"` OtherDataRaw TraceOtherData `json:"otherData,omitempty"` OtherData []*TraceOtherData `json:"otherDatas,omitempty"` }
type JSONTraceEvent ¶
type JSONTraceEvent struct { Name string `json:"name,omitempty"` Category string `json:"cat,omitempty"` EventType string `json:"ph,omitempty"` Timestamp int64 `json:"ts,omitempty"` // displayTimeUnit Duration int64 `json:"dur,omitempty"` // displayTimeUnit ProcessID int64 `json:"pid"` ThreadID int64 `json:"tid,omitempty"` Args interface{} `json:"args,omitempty"` Stack int `json:"sf,omitempty"` EndStack int `json:"esf,omitempty"` Init string `json:"init_time,omitempty"` Start int64 `json:"start,omitempty"` End int64 `json:"end,omitempty"` UPREnabled bool `json:"upr_enabled,omitempty"` }
type MemoryInformation ¶
type MemoryInformation []*Trace
type Trace ¶
type Trace struct { ID string `json:"id,omitempty"` ExperimentDescription string `json:"experiment_description,omitempty"` UPREnabled bool `json:"upr_enabled"` Iteration int64 `json:"iteration,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"` OtherDataRaw *TraceOtherData `json:"otherData,omitempty"` OtherData []*TraceOtherData `json:"otherDatas,omitempty"` }
func (Trace) AddTimestampOffset ¶
func (Trace) DeleteIgnoredEvents ¶
func (Trace) HTMLTemplate ¶
See https://github.com/catapult-project/catapult/blob/master/tracing/docs/embedding-trace-viewer.md This is almost verbatim copy of: https://github.com/catapult-project/catapult/blob/master/tracing/bin/index.html on revision 623a005a3ffa9de13c4b92bc72290e7bcd1ca591.
func (Trace) MaxEvent ¶
func (x Trace) MaxEvent() TraceEvent
func (Trace) MinEvent ¶
func (x Trace) MinEvent() TraceEvent
func (*Trace) UnmarshalJSON ¶
func (Trace) UpdateEventNames ¶
type TraceEvent ¶
type TraceEvent struct { Name string `json:"name,omitempty"` Category string `json:"cat,omitempty"` EventType string `json:"ph,omitempty"` Timestamp int64 `json:"ts"` // displayTimeUnit Duration time.Duration `json:"dur"` // displayTimeUnit ProcessID int64 `json:"pid"` ThreadID int64 `json:"tid,omitempty"` Args interface{} `json:"args,omitempty"` Stack int `json:"sf,omitempty"` EndStack int `json:"esf,omitempty"` Init string `json:"init_time,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"` UPREnabled bool `json:"upr_enabled"` TraceID string `json:"trace_id,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.
func (TraceEvent) Summarize ¶
func (x TraceEvent) Summarize() *TraceSummaryEvent
func (*TraceEvent) UnmarshalJSON ¶
func (x *TraceEvent) UnmarshalJSON(data []byte) error
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)
type TraceOtherData ¶
type TraceOtherData struct { ID string `json:"run_id,omitempty"` ServerInfo TraceServerInfo `json:"server,omitempty"` EndToEndProcessTime time.Duration `json:"end_to_end_process_time,omitempty"` EndToEndTime time.Duration `json:"end_to_end_time,omitempty"` UPREnabled bool `json:"upr_enabled"` UPRBaseDirectory string `json:"UPR_BASE_DIR"` EagerMode bool `json:"eager_mode"` EagerModeAsync bool `json:"eager_mode_async"` EndAt string `json:"end_at"` Git GitInfo `json:"git"` Hostname string `json:"hostname"` IsClient bool `json:"is_client"` ModelName string `json:"model_name"` ModelParams string `json:"model_params"` ModelPath string `json:"model_path"` StartAt string `json:"start_at"` SymbolParams string `json:"symbol_params"` Username string `json:"username"` MinEvent TraceEvent `json:"min_event"` MaxEvent TraceEvent `json:"max_event"` Iteration int64 `json:"iteration,omitempty"` Input map[string]interface{} `json:"input,omitempty"` ExperimentDescription string `json:"experiment_description,omitempty"` IsProcessed bool `json:"is_processed,omitempty"` }
func (TraceOtherData) Summarize ¶
func (x TraceOtherData) Summarize() (*TraceSummary, error)
type TraceServerInfo ¶
type TraceServerInfo struct { ID string `json:"server_id,omitempty"` StartTime time.Time `json:"server_start_time,omitempty"` EvictionPolicty string `json:"eviction_policy,omitempty"` EstimationRate float32 `json:"estimation_rate,omitempty"` MemoryPercentage float32 `json:"memory_percentage,omitempty"` PersistCPU bool `json:"persist_cpu"` }
type TraceSummary ¶
type TraceSummary struct { ID string `json:"run_id,omitempty"` ServerInfo TraceServerInfo `json:"server,omitempty"` EndToEndProcessTime time.Duration `json:"end_to_end_process_time,omitempty"` EndToEndTime time.Duration `json:"end_to_end_time,omitempty"` UPREnabled bool `json:"upr_enabled"` EagerMode bool `json:"eager_mode"` EagerModeAsync bool `json:"eager_mode_async"` Hostname string `json:"hostname"` ModelName string `json:"model_name"` ExperimentDescription string `json:"experiment_description,omitempty"` InitTime time.Time `json:"init_time,omitempty"` Events *TraceSummaryEvents `json:"events,omitempty"` }
type TraceSummaryEvent ¶
type TraceSummaryEvents ¶
type TraceSummaryEvents struct { CreatePrediction *TraceSummaryEvent `json:"create_prediction,omitempty"` LoadModel *TraceSummaryEvent `json:"load_model,omitempty"` GRPCOpen *TraceSummaryEvent `json:"grpc_open,omitempty"` NDArrayConvert *TraceSummaryEvent `json:"ndarray_convert,omitempty"` Predict *TraceSummaryEvent `json:"predict,omitempty"` LoadParams *TraceSummaryEvent `json:"load_params,omitempty"` ReadParams *TraceSummaryEvent `json:"read_params,omitempty"` SetPredictInput *TraceSummaryEvent `json:"set_predict_input,omitempty"` ForwardPredict *TraceSummaryEvent `json:"forward_predict,omitempty"` GetPredictOutputShape *TraceSummaryEvent `json:"get_output_shape,omitempty"` GetPredictOutput *TraceSummaryEvent `json:"get_output,omitempty"` FreePredictor *TraceSummaryEvent `json:"free_predictor,omitempty"` }
"load_params", "create", "set_input", "forward", "get_output_shape", "get_output", "free"