mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Use built-in benchmarking for expedition caching
This commit is contained in:
parent
8c1f556f29
commit
780cf148fa
@ -209,7 +209,7 @@ void Expedition::CacheFromDatabase(uint32_t expedition_id)
|
||||
{
|
||||
if (zone)
|
||||
{
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
BenchTimer benchmark;
|
||||
|
||||
auto results = ExpeditionDatabase::LoadExpedition(expedition_id);
|
||||
if (!results.Success())
|
||||
@ -220,9 +220,8 @@ void Expedition::CacheFromDatabase(uint32_t expedition_id)
|
||||
|
||||
CacheExpeditions(results);
|
||||
|
||||
auto end = std::chrono::steady_clock::now();
|
||||
auto elapsed = std::chrono::duration_cast<std::chrono::duration<float>>(end - start);
|
||||
LogExpeditions("Caching new expedition [{}] took {}s", expedition_id, elapsed.count());
|
||||
auto elapsed = benchmark.elapsed();
|
||||
LogExpeditions("Caching new expedition [{}] took {}s", expedition_id, elapsed);
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,7 +232,7 @@ bool Expedition::CacheAllFromDatabase()
|
||||
return false;
|
||||
}
|
||||
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
BenchTimer benchmark;
|
||||
|
||||
zone->expedition_cache.clear();
|
||||
|
||||
@ -247,9 +246,8 @@ bool Expedition::CacheAllFromDatabase()
|
||||
|
||||
CacheExpeditions(results);
|
||||
|
||||
auto end = std::chrono::steady_clock::now();
|
||||
auto elapsed = std::chrono::duration_cast<std::chrono::duration<float>>(end - start);
|
||||
LogExpeditions("Caching [{}] expedition(s) took {}s", zone->expedition_cache.size(), elapsed.count());
|
||||
auto elapsed = benchmark.elapsed();
|
||||
LogExpeditions("Caching [{}] expedition(s) took {}s", zone->expedition_cache.size(), elapsed);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ bool ExpeditionRequest::Validate(Client* requester)
|
||||
|
||||
// a message is sent to leader for every member that fails a requirement
|
||||
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
BenchTimer benchmark;
|
||||
|
||||
bool requirements_met = false;
|
||||
|
||||
@ -81,9 +81,8 @@ bool ExpeditionRequest::Validate(Client* requester)
|
||||
requirements_met = ValidateMembers(fmt::format("'{}'", m_leader_name), 1);
|
||||
}
|
||||
|
||||
auto end = std::chrono::steady_clock::now();
|
||||
auto elapsed = std::chrono::duration_cast<std::chrono::duration<float>>(end - start);
|
||||
LogExpeditions("Create validation for [{}] members took {}s", m_members.size(), elapsed.count());
|
||||
auto elapsed = benchmark.elapsed();
|
||||
LogExpeditions("Create validation for [{}] members took {}s", m_members.size(), elapsed);
|
||||
|
||||
return requirements_met;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user