Add a profile event about the number of merged sourceparts

This commit is contained in:
Alexey Milovidov 2024-10-21 22:40:30 +02:00
parent f41d604f28
commit 01db925bbc
2 changed files with 3 additions and 8 deletions

View File

@ -231,6 +231,7 @@
M(LoadedMarksMemoryBytes, "Size of in-memory representations of loaded marks.", ValueType::Bytes) \
\
M(Merge, "Number of launched background merges.", ValueType::Number) \
M(MergeSourceParts, "Number of source parts scheduled for merges.", ValueType::Number) \
M(MergedRows, "Rows read for background merges. This is the number of rows before merge.", ValueType::Number) \
M(MergedColumns, "Number of columns merged during the horizontal stage of merges.", ValueType::Number) \
M(GatheredColumns, "Number of columns gathered during the vertical stage of merges.", ValueType::Number) \

View File

@ -6,11 +6,8 @@
#include <fmt/format.h>
#include <Common/logger_useful.h>
#include <Common/ActionBlocker.h>
#include <Core/Settings.h>
#include <Common/ProfileEvents.h>
#include <Processors/Transforms/CheckSortedTransform.h>
#include <Storages/MergeTree/DataPartStorageOnDiskFull.h>
#include <Compression/CompressedWriteBuffer.h>
#include <DataTypes/ObjectUtils.h>
#include <DataTypes/Serializations/SerializationInfo.h>
@ -20,10 +17,8 @@
#include <Storages/MergeTree/MergeTreeSequentialSource.h>
#include <Storages/MergeTree/MergeTreeSettings.h>
#include <Storages/MergeTree/FutureMergedMutatedPart.h>
#include <Storages/MergeTree/MergeTreeDataMergerMutator.h>
#include <Storages/MergeTree/MergeTreeDataWriter.h>
#include <Storages/MergeTree/MergeProjectionPartsTask.h>
#include <Processors/Transforms/ExpressionTransform.h>
#include <Processors/Transforms/MaterializingTransform.h>
#include <Processors/Transforms/FilterTransform.h>
#include <Processors/Merges/MergingSortedTransform.h>
@ -34,9 +29,6 @@
#include <Processors/Merges/AggregatingSortedTransform.h>
#include <Processors/Merges/VersionedCollapsingTransform.h>
#include <Processors/Transforms/TTLTransform.h>
#include <Processors/Transforms/TTLCalcTransform.h>
#include <Processors/Transforms/DistinctSortedTransform.h>
#include <Processors/Transforms/DistinctTransform.h>
#include <Processors/QueryPlan/CreatingSetsStep.h>
#include <Processors/QueryPlan/DistinctStep.h>
#include <Processors/QueryPlan/Optimizations/QueryPlanOptimizationSettings.h>
@ -51,6 +43,7 @@
namespace ProfileEvents
{
extern const Event Merge;
extern const Event MergeSourceParts;
extern const Event MergedColumns;
extern const Event GatheredColumns;
extern const Event MergeTotalMilliseconds;
@ -302,6 +295,7 @@ void MergeTask::ExecuteAndFinalizeHorizontalPart::extractMergingAndGatheringColu
bool MergeTask::ExecuteAndFinalizeHorizontalPart::prepare() const
{
ProfileEvents::increment(ProfileEvents::Merge);
ProfileEvents::increment(ProfileEvents::MergeSourceParts, global_ctx->future_part->parts.size());
String local_tmp_prefix;
if (global_ctx->need_prefix)