コード例 #1
0
ファイル: query_list.go プロジェクト: Rastusik/vitess
// GetQueryzRows returns a list of QueryDetailzRow sorted by start time
func (ql *QueryList) GetQueryzRows() []QueryDetailzRow {
	ql.mu.Lock()
	rows := []QueryDetailzRow{}
	for _, qd := range ql.queryDetails {
		row := QueryDetailzRow{
			Query:       qd.conn.Current(),
			ContextHTML: callinfo.HTMLFromContext(qd.ctx),
			Start:       qd.start,
			Duration:    time.Now().Sub(qd.start),
			ConnID:      qd.connID,
		}
		rows = append(rows, row)
	}
	ql.mu.Unlock()
	sort.Sort(byStartTime(rows))
	return rows
}
コード例 #2
0
ファイル: logstats.go プロジェクト: yab/vitess
// 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 (stats *LogStats) ContextHTML() template.HTML {
	return callinfo.HTMLFromContext(stats.ctx)
}
コード例 #3
0
ファイル: sqlquery_stats.go プロジェクト: pranjal5215/vitess
// ContextHTML returns the HTML version of the context that was used, or "".
// This is a method on SQLQueryStats instead of a field so that it doesn't need
// to be passed by value everywhere.
func (stats *SQLQueryStats) ContextHTML() template.HTML {
	return callinfo.HTMLFromContext(stats.context)
}