Documentation ¶
Index ¶
- type LogStats
- func (stats *LogStats) ContextHTML() safehtml.HTML
- func (stats *LogStats) EffectiveCaller() string
- func (stats *LogStats) ErrorStr() string
- func (stats *LogStats) EventTime() time.Time
- func (stats *LogStats) ImmediateCaller() string
- func (stats *LogStats) Logf(w io.Writer, params url.Values) error
- func (stats *LogStats) RemoteAddrUsername() (string, string)
- func (stats *LogStats) SaveEndTime()
- func (stats *LogStats) TotalTime() time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogStats ¶
type LogStats struct { Ctx context.Context Method string TabletType string StmtType string SQL string BindVariables map[string]*querypb.BindVariable StartTime time.Time EndTime time.Time ShardQueries uint64 RowsAffected uint64 RowsReturned uint64 PlanTime time.Duration ExecuteTime time.Duration CommitTime time.Duration Error error TablesUsed []string SessionUUID string CachedPlan bool ActiveKeyspace string // ActiveKeyspace is the selected keyspace `use ks` }
LogStats records the stats for a single vtgate query
func NewLogStats ¶
func NewLogStats(ctx context.Context, methodName, sql, sessionUUID string, bindVars map[string]*querypb.BindVariable) *LogStats
NewLogStats constructs a new LogStats with supplied Method and ctx field values, and the StartTime field set to the present time.
func (*LogStats) ContextHTML ¶
ContextHTML returns the HTML version of the context that was used, or "". This is a method on LogStats instead of a field so that it doesn't need to be passed by value everywhere.
func (*LogStats) EffectiveCaller ¶
EffectiveCaller returns the effective caller stored in LogStats.Ctx
func (*LogStats) ImmediateCaller ¶
ImmediateCaller returns the immediate caller stored in LogStats.Ctx
func (*LogStats) Logf ¶
Logf formats the log record to the given writer, either as tab-separated list of logged fields or as JSON.
func (*LogStats) RemoteAddrUsername ¶
RemoteAddrUsername returns some parts of CallInfo if set
func (*LogStats) SaveEndTime ¶
func (stats *LogStats) SaveEndTime()
SaveEndTime sets the end time of this request to now