Example #1
0
func logExplain(prepared *plan.Prepared) {
	var pl plan.Operator = prepared
	explain, err := json.MarshalIndent(pl, "", "    ")
	if err != nil {
		logging.Tracep("Error logging explain", logging.Pair{"error", err})
		return
	}

	logging.Tracep("Explain ", logging.Pair{"explain", string(explain)})
}
Example #2
0
func logPhases(request Request) {
	phaseTimes := request.Output().PhaseTimes()
	if len(phaseTimes) == 0 {
		return
	}

	pairs := make([]logging.Pair, 0, len(phaseTimes)+1)
	pairs = append(pairs, logging.Pair{"_id", request.Id()})
	for k, v := range phaseTimes {
		pairs = append(pairs, logging.Pair{k, v})
	}

	logging.Tracep("Phase aggregates", pairs...)
}