8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 14:03:02 +01:00

Reset the statistics for every sub-request (aka call) execution.

This commit is contained in:
dimitr 2007-09-25 12:09:54 +00:00
parent 8f806ef115
commit 7903960607
3 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,11 @@ SINT64 RuntimeStatistics::getValue(size_t index) const
return values[index]; return values[index];
} }
void RuntimeStatistics::reset()
{
memset(values.begin(), 0, values.getCount() * sizeof(SINT64));
}
void RuntimeStatistics::bumpValue(thread_db* tdbb, size_t index) void RuntimeStatistics::bumpValue(thread_db* tdbb, size_t index)
{ {
fb_assert(tdbb); fb_assert(tdbb);

View File

@ -61,6 +61,7 @@ public:
void setParent(RuntimeStatistics*); void setParent(RuntimeStatistics*);
SINT64 getValue(size_t) const; SINT64 getValue(size_t) const;
void reset();
static void bumpValue(thread_db*, size_t); static void bumpValue(thread_db*, size_t);

View File

@ -672,6 +672,7 @@ jrd_req* EXE_find_request(thread_db* tdbb, jrd_req* request, bool validate)
} }
clone->req_attachment = tdbb->tdbb_attachment; clone->req_attachment = tdbb->tdbb_attachment;
clone->req_stats.setParent(&tdbb->tdbb_attachment->att_stats); clone->req_stats.setParent(&tdbb->tdbb_attachment->att_stats);
clone->req_stats.reset();
clone->req_flags |= req_in_use; clone->req_flags |= req_in_use;
dbb->dbb_mutexes[DBB_MUTX_clone].leave(); dbb->dbb_mutexes[DBB_MUTX_clone].leave();
return clone; return clone;