MCPcopy Index your code
hub / github.com/uber/aresdb / writeToLog

Method writeToLog

query/stats.go:213–231  ·  view source on GitHub ↗

writeToLog writes the summary stats for this query in a tabular format to logger.

()

Source from the content-addressed store, hash-verified

211
212// writeToLog writes the summary stats for this query in a tabular format to logger.
213func (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.
234func (qc *AQLQueryContext) reportBatch(isArchiveBatch bool) {

Callers 2

stats_test.goFile · 0.80
ProcessQueryMethod · 0.80

Calls 5

GetQueryLoggerFunction · 0.92
WriteTableFunction · 0.92
stageSummaryStatsSliceTypeAlias · 0.85
InfofMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected