try {
Statistic statistic = do_cache_compilation(*ctx, argv);
- stats_update(*ctx, statistic);
+ ctx->counter_updates[statistic] += 1;
return EXIT_SUCCESS;
} catch (const Failure& e) {
if (e.statistic() != Statistic::none) {
- stats_update(*ctx, e.statistic());
+ ctx->counter_updates[e.statistic()] += 1;
}
if (e.exit_code()) {
stats_flush_to_file(ctx.config, ctx.stats_file(), ctx.counter_updates);
}
-// Update a normal statistics counter.
-void
-stats_update(Context& ctx, Statistic statistic)
-{
- assert(statistic > Statistic::none && statistic < Statistic::END);
- ctx.counter_updates[statistic] += 1;
-}
-
// Sum and display the total stats for all cache dirs.
void
stats_summary(const Context& ctx)
END
};
-void stats_update(Context& ctx, Statistic statistic);
void stats_flush(Context& ctx);
void stats_flush_to_file(const Config& config,
const std::string& sfile,