dbms: more instrumentation [#METR-2944].

This commit is contained in:
Alexey Milovidov 2014-01-04 04:53:07 +00:00
parent 6820638c30
commit a57d64b7fa
4 changed files with 17 additions and 0 deletions

View File

@ -5,6 +5,7 @@
#include <vector>
#include <Poco/SharedPtr.h>
#include <Yandex/likely.h>
#include <DB/Common/ProfileEvents.h>
namespace DB
@ -33,6 +34,9 @@ private:
Chunk(size_t size_, Chunk * prev_)
{
ProfileEvents::increment(ProfileEvents::ArenaAllocChunks);
ProfileEvents::increment(ProfileEvents::ArenaAllocBytes, size_);
begin = allocate(size_);
pos = begin;
end = begin + size_;

View File

@ -19,6 +19,11 @@
M(CompressedReadBufferBytes, "Read decompressed bytes") \
M(UncompressedCacheHits, "Uncompressed cache hits") \
M(UncompressedCacheMisses, "Uncompressed cache misses") \
M(IOBufferAllocs, "IO buffers allocations") \
M(IOBufferAllocBytes, "IO buffers allocated bytes") \
M(ArenaAllocChunks, "Arena allocated chunks") \
M(ArenaAllocBytes, "Arena allocated bytes") \
M(FunctionExecute, "Function executes") \
\
M(END, "")

View File

@ -2,6 +2,8 @@
#include <boost/noncopyable.hpp>
#include <DB/Common/ProfileEvents.h>
#include <DB/Core/Exception.h>
#include <DB/Core/ErrorCodes.h>
@ -67,6 +69,9 @@ private:
return;
}
ProfileEvents::increment(ProfileEvents::IOBufferAllocs);
ProfileEvents::increment(ProfileEvents::IOBufferAllocBytes, m_capacity);
if (!alignment)
{
m_data = reinterpret_cast<char *>(malloc(m_capacity));

View File

@ -1,3 +1,4 @@
#include <DB/Common/ProfileEvents.h>
#include <DB/Interpreters/ExpressionActions.h>
#include <DB/Columns/ColumnsNumber.h>
#include <DB/Columns/ColumnArray.h>
@ -6,6 +7,7 @@
#include <DB/Functions/IFunction.h>
#include <set>
namespace DB
{
@ -196,6 +198,7 @@ void ExpressionActions::Action::execute(Block & block) const
new_column.type = result_type;
block.insert(new_column);
ProfileEvents::increment(ProfileEvents::FunctionExecute);
function->execute(block, arguments, prerequisites, block.getPositionByName(result_name));
break;