}
core::Statistics statistics(ctx.storage.primary.get_statistics_updates());
- for (const auto& message : statistics.get_statistics_messages()) {
+ for (const auto& message : statistics.get_statistics_ids()) {
LOG("Result: {}", message);
}
}
return get_statistics_fields(m_counters, true);
}
-std::vector<std::string>
-Statistics::get_statistics_messages() const
-{
- return get_statistics_fields(m_counters, false);
-}
-
std::string
Statistics::format_config_header(const Config& config)
{
// Return machine-readable strings representing the statistics counters.
std::vector<std::string> get_statistics_ids() const;
- // Return human-readable strings representing the statistics counters.
- std::vector<std::string> get_statistics_messages() const;
-
// Format config header in human-readable format.
static std::string format_config_header(const Config& config);
TEST "CCACHE_DEBUGDIR"
CCACHE_DEBUG=1 CCACHE_DEBUGDIR=debugdir $CCACHE_COMPILE -c test1.c
- expect_contains debugdir"$(pwd -P)"/test1.o.ccache-log "Result: cache miss"
+ expect_contains debugdir"$(pwd -P)"/test1.o.ccache-log "Result: cache_miss"
# -------------------------------------------------------------------------
TEST "CCACHE_DISABLE"
CHECK(Statistics(counters).get_statistics_ids() == expected);
}
-TEST_CASE("get_statistics_messages")
-{
- TestContext test_context;
-
- StatisticsCounters counters;
- counters.increment(Statistic::cache_size_kibibyte);
- counters.increment(Statistic::cache_miss);
- counters.increment(Statistic::direct_cache_hit);
- counters.increment(Statistic::autoconf_test);
-
- std::vector<std::string> expected = {
- "autoconf compile/link", "cache hit (direct)", "cache miss"};
- CHECK(Statistics(counters).get_statistics_messages() == expected);
-}
-
TEST_SUITE_END();