writeToLog writes the summary stats for this query in a tabular format to logger.
()
| 211 | |
| 212 | // writeToLog writes the summary stats for this query in a tabular format to logger. |
| 213 | func (stats *oopkQueryStats) writeToLog() { |
| 214 | if stats.NumBatches+stats.NumBatchSkipped > 0 { |
| 215 | // Compute average and percentage. |
| 216 | stats.stageStats = make([]*oopkStageSummaryStats, 0, len(stats.Name2Stage)) |
| 217 | for _, oopkStageStats := range stats.Name2Stage { |
| 218 | oopkStageStats.avg = oopkStageStats.total / float64(stats.NumBatches) |
| 219 | oopkStageStats.percentage = oopkStageStats.total / stats.TotalTiming |
| 220 | stats.stageStats = append(stats.stageStats, oopkStageStats) |
| 221 | } |
| 222 | sort.Sort(sort.Reverse(stageSummaryStatsSlice(stats.stageStats))) |
| 223 | |
| 224 | utils.GetQueryLogger().Infof("Total timing: %f", stats.TotalTiming) |
| 225 | utils.GetQueryLogger().Infof("Num batches: %d", stats.NumBatches) |
| 226 | utils.GetQueryLogger().Infof("Num batches skipped: %d", stats.NumBatchSkipped) |
| 227 | // Create tabular output. |
| 228 | summary := utils.WriteTable(stats) |
| 229 | utils.GetQueryLogger().Info("\n" + summary) |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | // reportBatch will report OOPK batch related stats to the query logger. |
| 234 | func (qc *AQLQueryContext) reportBatch(isArchiveBatch bool) { |
no test coverage detected