Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
77b7158c
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
77b7158c
编写于
5月 20, 2019
作者:
G
Guillaume Tassery
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Progress rename for total_rows and write_[rows|bytes]
上级
9c295fa5
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
126 addition
and
122 deletion
+126
-122
dbms/programs/benchmark/Benchmark.cpp
dbms/programs/benchmark/Benchmark.cpp
+2
-2
dbms/programs/performance-test/executeQuery.cpp
dbms/programs/performance-test/executeQuery.cpp
+1
-1
dbms/src/DataStreams/CountingBlockOutputStream.cpp
dbms/src/DataStreams/CountingBlockOutputStream.cpp
+2
-2
dbms/src/DataStreams/IBlockInputStream.cpp
dbms/src/DataStreams/IBlockInputStream.cpp
+16
-16
dbms/src/Formats/JSONRowOutputStream.cpp
dbms/src/Formats/JSONRowOutputStream.cpp
+2
-2
dbms/src/Formats/XMLRowOutputStream.cpp
dbms/src/Formats/XMLRowOutputStream.cpp
+2
-2
dbms/src/IO/Progress.cpp
dbms/src/IO/Progress.cpp
+31
-31
dbms/src/IO/Progress.h
dbms/src/IO/Progress.h
+49
-49
dbms/src/Interpreters/ProcessList.cpp
dbms/src/Interpreters/ProcessList.cpp
+7
-5
dbms/src/Interpreters/ThreadStatusExt.cpp
dbms/src/Interpreters/ThreadStatusExt.cpp
+6
-4
dbms/src/Interpreters/executeQuery.cpp
dbms/src/Interpreters/executeQuery.cpp
+2
-2
dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp
dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp
+6
-6
未找到文件。
dbms/programs/benchmark/Benchmark.cpp
浏览文件 @
77b7158c
...
...
@@ -325,8 +325,8 @@ private:
double
seconds
=
watch
.
elapsedSeconds
();
std
::
lock_guard
lock
(
mutex
);
info_per_interval
.
add
(
seconds
,
progress
.
r
ows
,
progress
.
bytes
,
info
.
rows
,
info
.
bytes
);
info_total
.
add
(
seconds
,
progress
.
r
ows
,
progress
.
bytes
,
info
.
rows
,
info
.
bytes
);
info_per_interval
.
add
(
seconds
,
progress
.
r
ead_rows
,
progress
.
read_
bytes
,
info
.
rows
,
info
.
bytes
);
info_total
.
add
(
seconds
,
progress
.
r
ead_rows
,
progress
.
read_
bytes
,
info
.
rows
,
info
.
bytes
);
}
...
...
dbms/programs/performance-test/executeQuery.cpp
浏览文件 @
77b7158c
...
...
@@ -13,7 +13,7 @@ void checkFulfilledConditionsAndUpdate(
TestStats
&
statistics
,
TestStopConditions
&
stop_conditions
,
InterruptListener
&
interrupt_listener
)
{
statistics
.
add
(
progress
.
r
ows
,
progress
.
bytes
);
statistics
.
add
(
progress
.
r
ead_rows
,
progress
.
read_
bytes
);
stop_conditions
.
reportRowsRead
(
statistics
.
total_rows_read
);
stop_conditions
.
reportBytesReadUncompressed
(
statistics
.
total_bytes_read
);
...
...
dbms/src/DataStreams/CountingBlockOutputStream.cpp
浏览文件 @
77b7158c
...
...
@@ -19,8 +19,8 @@ void CountingBlockOutputStream::write(const Block & block)
Progress
local_progress
(
block
.
rows
(),
block
.
bytes
(),
0
);
progress
.
incrementPiecewiseAtomically
(
local_progress
);
ProfileEvents
::
increment
(
ProfileEvents
::
InsertedRows
,
local_progress
.
rows
);
ProfileEvents
::
increment
(
ProfileEvents
::
InsertedBytes
,
local_progress
.
bytes
);
ProfileEvents
::
increment
(
ProfileEvents
::
InsertedRows
,
local_progress
.
r
ead_r
ows
);
ProfileEvents
::
increment
(
ProfileEvents
::
InsertedBytes
,
local_progress
.
read_
bytes
);
if
(
process_elem
)
process_elem
->
updateProgressOut
(
local_progress
);
...
...
dbms/src/DataStreams/IBlockInputStream.cpp
浏览文件 @
77b7158c
...
...
@@ -281,7 +281,7 @@ void IBlockInputStream::progressImpl(const Progress & value)
/// The total amount of data processed or intended for processing in all leaf sources, possibly on remote servers.
ProgressValues
progress
=
process_list_elem
->
getProgressIn
();
size_t
total_rows_estimate
=
std
::
max
(
progress
.
r
ows
,
progress
.
total_rows
);
size_t
total_rows_estimate
=
std
::
max
(
progress
.
r
ead_rows
,
progress
.
total_rows_to_read
);
/** Check the restrictions on the amount of data to read, the speed of the query, the quota on the amount of data to read.
* NOTE: Maybe it makes sense to have them checked directly in ProcessList?
...
...
@@ -289,7 +289,7 @@ void IBlockInputStream::progressImpl(const Progress & value)
if
(
limits
.
mode
==
LIMITS_TOTAL
&&
((
limits
.
size_limits
.
max_rows
&&
total_rows_estimate
>
limits
.
size_limits
.
max_rows
)
||
(
limits
.
size_limits
.
max_bytes
&&
progress
.
bytes
>
limits
.
size_limits
.
max_bytes
)))
||
(
limits
.
size_limits
.
max_bytes
&&
progress
.
read_
bytes
>
limits
.
size_limits
.
max_bytes
)))
{
switch
(
limits
.
size_limits
.
overflow_mode
)
{
...
...
@@ -300,7 +300,7 @@ void IBlockInputStream::progressImpl(const Progress & value)
+
" rows read (or to read), maximum: "
+
toString
(
limits
.
size_limits
.
max_rows
),
ErrorCodes
::
TOO_MANY_ROWS
);
else
throw
Exception
(
"Limit for (uncompressed) bytes to read exceeded: "
+
toString
(
progress
.
bytes
)
throw
Exception
(
"Limit for (uncompressed) bytes to read exceeded: "
+
toString
(
progress
.
read_
bytes
)
+
" bytes read, maximum: "
+
toString
(
limits
.
size_limits
.
max_bytes
),
ErrorCodes
::
TOO_MANY_BYTES
);
}
...
...
@@ -308,8 +308,8 @@ void IBlockInputStream::progressImpl(const Progress & value)
case
OverflowMode
::
BREAK
:
{
/// For `break`, we will stop only if so many rows were actually read, and not just supposed to be read.
if
((
limits
.
size_limits
.
max_rows
&&
progress
.
rows
>
limits
.
size_limits
.
max_rows
)
||
(
limits
.
size_limits
.
max_bytes
&&
progress
.
bytes
>
limits
.
size_limits
.
max_bytes
))
if
((
limits
.
size_limits
.
max_rows
&&
progress
.
r
ead_r
ows
>
limits
.
size_limits
.
max_rows
)
||
(
limits
.
size_limits
.
max_bytes
&&
progress
.
read_
bytes
>
limits
.
size_limits
.
max_bytes
))
{
cancel
(
false
);
}
...
...
@@ -322,7 +322,7 @@ void IBlockInputStream::progressImpl(const Progress & value)
}
}
size_t
total_rows
=
progress
.
total_rows
;
size_t
total_rows
=
progress
.
total_rows
_to_read
;
constexpr
UInt64
profile_events_update_period_microseconds
=
10
*
1000
;
// 10 milliseconds
UInt64
total_elapsed_microseconds
=
info
.
total_stopwatch
.
elapsedMicroseconds
();
...
...
@@ -344,20 +344,20 @@ void IBlockInputStream::progressImpl(const Progress & value)
if
(
elapsed_seconds
>
0
)
{
if
(
limits
.
min_execution_speed
&&
progress
.
rows
/
elapsed_seconds
<
limits
.
min_execution_speed
)
throw
Exception
(
"Query is executing too slow: "
+
toString
(
progress
.
rows
/
elapsed_seconds
)
if
(
limits
.
min_execution_speed
&&
progress
.
r
ead_r
ows
/
elapsed_seconds
<
limits
.
min_execution_speed
)
throw
Exception
(
"Query is executing too slow: "
+
toString
(
progress
.
r
ead_r
ows
/
elapsed_seconds
)
+
" rows/sec., minimum: "
+
toString
(
limits
.
min_execution_speed
),
ErrorCodes
::
TOO_SLOW
);
if
(
limits
.
min_execution_speed_bytes
&&
progress
.
bytes
/
elapsed_seconds
<
limits
.
min_execution_speed_bytes
)
throw
Exception
(
"Query is executing too slow: "
+
toString
(
progress
.
bytes
/
elapsed_seconds
)
if
(
limits
.
min_execution_speed_bytes
&&
progress
.
read_
bytes
/
elapsed_seconds
<
limits
.
min_execution_speed_bytes
)
throw
Exception
(
"Query is executing too slow: "
+
toString
(
progress
.
read_
bytes
/
elapsed_seconds
)
+
" bytes/sec., minimum: "
+
toString
(
limits
.
min_execution_speed_bytes
),
ErrorCodes
::
TOO_SLOW
);
/// If the predicted execution time is longer than `max_execution_time`.
if
(
limits
.
max_execution_time
!=
0
&&
total_rows
)
{
double
estimated_execution_time_seconds
=
elapsed_seconds
*
(
static_cast
<
double
>
(
total_rows
)
/
progress
.
rows
);
double
estimated_execution_time_seconds
=
elapsed_seconds
*
(
static_cast
<
double
>
(
total_rows
)
/
progress
.
r
ead_r
ows
);
if
(
estimated_execution_time_seconds
>
limits
.
max_execution_time
.
totalSeconds
())
throw
Exception
(
"Estimated query execution time ("
+
toString
(
estimated_execution_time_seconds
)
+
" seconds)"
...
...
@@ -366,17 +366,17 @@ void IBlockInputStream::progressImpl(const Progress & value)
ErrorCodes
::
TOO_SLOW
);
}
if
(
limits
.
max_execution_speed
&&
progress
.
rows
/
elapsed_seconds
>=
limits
.
max_execution_speed
)
limitProgressingSpeed
(
progress
.
rows
,
limits
.
max_execution_speed
,
total_elapsed_microseconds
);
if
(
limits
.
max_execution_speed
&&
progress
.
r
ead_r
ows
/
elapsed_seconds
>=
limits
.
max_execution_speed
)
limitProgressingSpeed
(
progress
.
r
ead_r
ows
,
limits
.
max_execution_speed
,
total_elapsed_microseconds
);
if
(
limits
.
max_execution_speed_bytes
&&
progress
.
bytes
/
elapsed_seconds
>=
limits
.
max_execution_speed_bytes
)
limitProgressingSpeed
(
progress
.
bytes
,
limits
.
max_execution_speed_bytes
,
total_elapsed_microseconds
);
if
(
limits
.
max_execution_speed_bytes
&&
progress
.
read_
bytes
/
elapsed_seconds
>=
limits
.
max_execution_speed_bytes
)
limitProgressingSpeed
(
progress
.
read_
bytes
,
limits
.
max_execution_speed_bytes
,
total_elapsed_microseconds
);
}
}
if
(
quota
!=
nullptr
&&
limits
.
mode
==
LIMITS_TOTAL
)
{
quota
->
checkAndAddReadRowsBytes
(
time
(
nullptr
),
value
.
r
ows
,
value
.
bytes
);
quota
->
checkAndAddReadRowsBytes
(
time
(
nullptr
),
value
.
r
ead_rows
,
value
.
read_
bytes
);
}
}
}
...
...
dbms/src/Formats/JSONRowOutputStream.cpp
浏览文件 @
77b7158c
...
...
@@ -220,10 +220,10 @@ void JSONRowOutputStream::writeStatistics()
writeText
(
watch
.
elapsedSeconds
(),
*
ostr
);
writeCString
(
",
\n
"
,
*
ostr
);
writeCString
(
"
\t\t\"
rows_read
\"
: "
,
*
ostr
);
writeText
(
progress
.
rows
.
load
(),
*
ostr
);
writeText
(
progress
.
r
ead_r
ows
.
load
(),
*
ostr
);
writeCString
(
",
\n
"
,
*
ostr
);
writeCString
(
"
\t\t\"
bytes_read
\"
: "
,
*
ostr
);
writeText
(
progress
.
bytes
.
load
(),
*
ostr
);
writeText
(
progress
.
read_
bytes
.
load
(),
*
ostr
);
writeChar
(
'\n'
,
*
ostr
);
writeCString
(
"
\t
}"
,
*
ostr
);
...
...
dbms/src/Formats/XMLRowOutputStream.cpp
浏览文件 @
77b7158c
...
...
@@ -215,10 +215,10 @@ void XMLRowOutputStream::writeStatistics()
writeText
(
watch
.
elapsedSeconds
(),
*
ostr
);
writeCString
(
"</elapsed>
\n
"
,
*
ostr
);
writeCString
(
"
\t\t
<rows_read>"
,
*
ostr
);
writeText
(
progress
.
rows
.
load
(),
*
ostr
);
writeText
(
progress
.
r
ead_r
ows
.
load
(),
*
ostr
);
writeCString
(
"</rows_read>
\n
"
,
*
ostr
);
writeCString
(
"
\t\t
<bytes_read>"
,
*
ostr
);
writeText
(
progress
.
bytes
.
load
(),
*
ostr
);
writeText
(
progress
.
read_
bytes
.
load
(),
*
ostr
);
writeCString
(
"</bytes_read>
\n
"
,
*
ostr
);
writeCString
(
"
\t
</statistics>
\n
"
,
*
ostr
);
}
...
...
dbms/src/IO/Progress.cpp
浏览文件 @
77b7158c
...
...
@@ -10,38 +10,38 @@ namespace DB
{
void
ProgressValues
::
read
(
ReadBuffer
&
in
,
UInt64
server_revision
)
{
size_t
new_rows
=
0
;
size_t
new_bytes
=
0
;
size_t
new_total_rows
=
0
;
size_t
new_writ
e
_rows
=
0
;
size_t
new_writ
e
_bytes
=
0
;
size_t
new_r
ead_r
ows
=
0
;
size_t
new_
read_
bytes
=
0
;
size_t
new_total_rows
_to_read
=
0
;
size_t
new_writ
ten
_rows
=
0
;
size_t
new_writ
ten
_bytes
=
0
;
readVarUInt
(
new_rows
,
in
);
readVarUInt
(
new_bytes
,
in
);
readVarUInt
(
new_total_rows
,
in
);
readVarUInt
(
new_r
ead_r
ows
,
in
);
readVarUInt
(
new_
read_
bytes
,
in
);
readVarUInt
(
new_total_rows
_to_read
,
in
);
if
(
server_revision
>=
DBMS_MIN_REVISION_WITH_CLIENT_WRITE_INFO
)
{
readVarUInt
(
new_writ
e
_rows
,
in
);
readVarUInt
(
new_writ
e
_bytes
,
in
);
readVarUInt
(
new_writ
ten
_rows
,
in
);
readVarUInt
(
new_writ
ten
_bytes
,
in
);
}
this
->
r
ows
=
new
_rows
;
this
->
bytes
=
new
_bytes
;
this
->
total_rows
=
new_total_rows
;
this
->
writ
e_rows
=
new_write
_rows
;
this
->
writ
e_bytes
=
new_write
_bytes
;
this
->
r
ead_rows
=
new_read
_rows
;
this
->
read_bytes
=
new_read
_bytes
;
this
->
total_rows
_to_read
=
new_total_rows_to_read
;
this
->
writ
ten_rows
=
new_written
_rows
;
this
->
writ
ten_bytes
=
new_written
_bytes
;
}
void
ProgressValues
::
write
(
WriteBuffer
&
out
,
UInt64
client_revision
)
const
{
writeVarUInt
(
this
->
rows
,
out
);
writeVarUInt
(
this
->
bytes
,
out
);
writeVarUInt
(
this
->
total_rows
,
out
);
writeVarUInt
(
this
->
r
ead_r
ows
,
out
);
writeVarUInt
(
this
->
read_
bytes
,
out
);
writeVarUInt
(
this
->
total_rows
_to_read
,
out
);
if
(
client_revision
>=
DBMS_MIN_REVISION_WITH_CLIENT_WRITE_INFO
)
{
writeVarUInt
(
this
->
writ
e
_rows
,
out
);
writeVarUInt
(
this
->
writ
e
_bytes
,
out
);
writeVarUInt
(
this
->
writ
ten
_rows
,
out
);
writeVarUInt
(
this
->
writ
ten
_bytes
,
out
);
}
}
...
...
@@ -51,15 +51,15 @@ void ProgressValues::writeJSON(WriteBuffer & out) const
/// of 64-bit integers after interpretation by JavaScript.
writeCString
(
"{
\"
read_rows
\"
:
\"
"
,
out
);
writeText
(
this
->
rows
,
out
);
writeText
(
this
->
r
ead_r
ows
,
out
);
writeCString
(
"
\"
,
\"
read_bytes
\"
:
\"
"
,
out
);
writeText
(
this
->
bytes
,
out
);
writeText
(
this
->
read_
bytes
,
out
);
writeCString
(
"
\"
,
\"
written_rows
\"
:
\"
"
,
out
);
writeText
(
this
->
writ
e
_rows
,
out
);
writeText
(
this
->
writ
ten
_rows
,
out
);
writeCString
(
"
\"
,
\"
written_bytes
\"
:
\"
"
,
out
);
writeText
(
this
->
writ
e
_bytes
,
out
);
writeCString
(
"
\"
,
\"
rows_in_set
\"
:
\"
"
,
out
);
writeText
(
this
->
total_rows
,
out
);
writeText
(
this
->
writ
ten
_bytes
,
out
);
writeCString
(
"
\"
,
\"
total_rows_to_read
\"
:
\"
"
,
out
);
writeText
(
this
->
total_rows
_to_read
,
out
);
writeCString
(
"
\"
}"
,
out
);
}
...
...
@@ -68,11 +68,11 @@ void Progress::read(ReadBuffer & in, UInt64 server_revision)
ProgressValues
values
;
values
.
read
(
in
,
server_revision
);
r
ows
.
store
(
values
.
rows
,
std
::
memory_order_relaxed
);
bytes
.
store
(
values
.
bytes
,
std
::
memory_order_relaxed
);
total_rows
.
store
(
values
.
total_rows
,
std
::
memory_order_relaxed
);
writ
e_rows
.
store
(
values
.
write
_rows
,
std
::
memory_order_relaxed
);
writ
e_bytes
.
store
(
values
.
write
_bytes
,
std
::
memory_order_relaxed
);
r
ead_rows
.
store
(
values
.
read_
rows
,
std
::
memory_order_relaxed
);
read_bytes
.
store
(
values
.
read_
bytes
,
std
::
memory_order_relaxed
);
total_rows
_to_read
.
store
(
values
.
total_rows_to_read
,
std
::
memory_order_relaxed
);
writ
ten_rows
.
store
(
values
.
written
_rows
,
std
::
memory_order_relaxed
);
writ
ten_bytes
.
store
(
values
.
written
_bytes
,
std
::
memory_order_relaxed
);
}
void
Progress
::
write
(
WriteBuffer
&
out
,
UInt64
client_revision
)
const
...
...
dbms/src/IO/Progress.h
浏览文件 @
77b7158c
...
...
@@ -15,11 +15,11 @@ class WriteBuffer;
/// See Progress.
struct
ProgressValues
{
size_t
rows
;
size_t
bytes
;
size_t
total_rows
;
size_t
writ
e
_rows
;
size_t
writ
e
_bytes
;
size_t
r
ead_r
ows
;
size_t
read_
bytes
;
size_t
total_rows
_to_read
;
size_t
writ
ten
_rows
;
size_t
writ
ten
_bytes
;
void
read
(
ReadBuffer
&
in
,
UInt64
server_revision
);
void
write
(
WriteBuffer
&
out
,
UInt64
client_revision
)
const
;
...
...
@@ -28,21 +28,21 @@ struct ProgressValues
struct
ReadProgress
{
size_t
rows
;
size_t
bytes
;
size_t
total_rows
;
size_t
r
ead_r
ows
;
size_t
read_
bytes
;
size_t
total_rows
_to_read
;
ReadProgress
(
size_t
r
ows_
,
size_t
bytes_
,
size_t
total_rows
_
=
0
)
:
r
ows
(
rows_
),
bytes
(
bytes_
),
total_rows
(
total_rows
_
)
{}
ReadProgress
(
size_t
r
ead_rows_
,
size_t
read_bytes_
,
size_t
total_rows_to_read
_
=
0
)
:
r
ead_rows
(
read_rows_
),
read_bytes
(
read_bytes_
),
total_rows_to_read
(
total_rows_to_read
_
)
{}
};
struct
WriteProgress
{
size_t
writ
e
_rows
;
size_t
writ
e
_bytes
;
size_t
writ
ten
_rows
;
size_t
writ
ten
_bytes
;
WriteProgress
(
size_t
writ
e_rows_
,
size_t
write
_bytes_
)
:
writ
e_rows
(
write_rows_
),
write_bytes
(
write
_bytes_
)
{}
WriteProgress
(
size_t
writ
ten_rows_
,
size_t
written
_bytes_
)
:
writ
ten_rows
(
written_rows_
),
written_bytes
(
written
_bytes_
)
{}
};
/** Progress of query execution.
...
...
@@ -51,26 +51,26 @@ struct WriteProgress
*/
struct
Progress
{
std
::
atomic
<
size_t
>
rows
{
0
};
/// Rows (source) processed.
std
::
atomic
<
size_t
>
bytes
{
0
};
/// Bytes (uncompressed, source) processed.
std
::
atomic
<
size_t
>
r
ead_r
ows
{
0
};
/// Rows (source) processed.
std
::
atomic
<
size_t
>
read_
bytes
{
0
};
/// Bytes (uncompressed, source) processed.
/** How much rows must be processed, in total, approximately. Non-zero value is sent when there is information about some new part of job.
* Received values must be summed to get estimate of total rows to process.
* Used for rendering progress bar on client.
*/
std
::
atomic
<
size_t
>
total_rows
{
0
};
std
::
atomic
<
size_t
>
total_rows
_to_read
{
0
};
std
::
atomic
<
size_t
>
writ
e
_rows
{
0
};
std
::
atomic
<
size_t
>
writ
e
_bytes
{
0
};
std
::
atomic
<
size_t
>
writ
ten
_rows
{
0
};
std
::
atomic
<
size_t
>
writ
ten
_bytes
{
0
};
Progress
()
{}
Progress
(
size_t
r
ows_
,
size_t
bytes_
,
size_t
total_rows
_
=
0
)
:
r
ows
(
rows_
),
bytes
(
bytes_
),
total_rows
(
total_rows
_
)
{}
Progress
(
size_t
r
ead_rows_
,
size_t
read_bytes_
,
size_t
total_rows_to_read
_
=
0
)
:
r
ead_rows
(
read_rows_
),
read_bytes
(
read_bytes_
),
total_rows_to_read
(
total_rows_to_read
_
)
{}
Progress
(
ReadProgress
read_progress
)
:
r
ows
(
read_progress
.
rows
),
bytes
(
read_progress
.
bytes
),
total_rows
(
read_progress
.
total_rows
)
{}
:
r
ead_rows
(
read_progress
.
read_rows
),
read_bytes
(
read_progress
.
read_bytes
),
total_rows_to_read
(
read_progress
.
total_rows_to_read
)
{}
Progress
(
WriteProgress
write_progress
)
:
writ
e_rows
(
write_progress
.
write_rows
),
write_bytes
(
write_progress
.
write
_bytes
)
{}
:
writ
ten_rows
(
write_progress
.
written_rows
),
written_bytes
(
write_progress
.
written
_bytes
)
{}
void
read
(
ReadBuffer
&
in
,
UInt64
server_revision
);
void
write
(
WriteBuffer
&
out
,
UInt64
client_revision
)
const
;
...
...
@@ -80,33 +80,33 @@ struct Progress
/// Each value separately is changed atomically (but not whole object).
bool
incrementPiecewiseAtomically
(
const
Progress
&
rhs
)
{
r
ows
+=
rhs
.
rows
;
bytes
+=
rhs
.
bytes
;
total_rows
+=
rhs
.
total_rows
;
writ
e_rows
+=
rhs
.
write
_rows
;
writ
e_bytes
+=
rhs
.
write
_bytes
;
r
ead_rows
+=
rhs
.
read_
rows
;
read_bytes
+=
rhs
.
read_
bytes
;
total_rows
_to_read
+=
rhs
.
total_rows_to_read
;
writ
ten_rows
+=
rhs
.
written
_rows
;
writ
ten_bytes
+=
rhs
.
written
_bytes
;
return
rhs
.
r
ows
||
rhs
.
write
_rows
?
true
:
false
;
return
rhs
.
r
ead_rows
||
rhs
.
written
_rows
?
true
:
false
;
}
void
reset
()
{
rows
=
0
;
bytes
=
0
;
total_rows
=
0
;
writ
e
_rows
=
0
;
writ
e
_bytes
=
0
;
r
ead_r
ows
=
0
;
read_
bytes
=
0
;
total_rows
_to_read
=
0
;
writ
ten
_rows
=
0
;
writ
ten
_bytes
=
0
;
}
ProgressValues
getValues
()
const
{
ProgressValues
res
;
res
.
r
ows
=
rows
.
load
(
std
::
memory_order_relaxed
);
res
.
bytes
=
bytes
.
load
(
std
::
memory_order_relaxed
);
res
.
total_rows
=
total_rows
.
load
(
std
::
memory_order_relaxed
);
res
.
writ
e_rows
=
write
_rows
.
load
(
std
::
memory_order_relaxed
);
res
.
writ
e_bytes
=
write
_bytes
.
load
(
std
::
memory_order_relaxed
);
res
.
r
ead_rows
=
read_
rows
.
load
(
std
::
memory_order_relaxed
);
res
.
read_bytes
=
read_
bytes
.
load
(
std
::
memory_order_relaxed
);
res
.
total_rows
_to_read
=
total_rows_to_read
.
load
(
std
::
memory_order_relaxed
);
res
.
writ
ten_rows
=
written
_rows
.
load
(
std
::
memory_order_relaxed
);
res
.
writ
ten_bytes
=
written
_bytes
.
load
(
std
::
memory_order_relaxed
);
return
res
;
}
...
...
@@ -115,22 +115,22 @@ struct Progress
{
ProgressValues
res
;
res
.
r
ows
=
rows
.
fetch_and
(
0
);
res
.
bytes
=
bytes
.
fetch_and
(
0
);
res
.
total_rows
=
total_rows
.
fetch_and
(
0
);
res
.
writ
e_rows
=
write
_rows
.
fetch_and
(
0
);
res
.
writ
e_bytes
=
write
_bytes
.
fetch_and
(
0
);
res
.
r
ead_rows
=
read_
rows
.
fetch_and
(
0
);
res
.
read_bytes
=
read_
bytes
.
fetch_and
(
0
);
res
.
total_rows
_to_read
=
total_rows_to_read
.
fetch_and
(
0
);
res
.
writ
ten_rows
=
written
_rows
.
fetch_and
(
0
);
res
.
writ
ten_bytes
=
written
_bytes
.
fetch_and
(
0
);
return
res
;
}
Progress
&
operator
=
(
Progress
&&
other
)
{
r
ows
=
other
.
rows
.
load
(
std
::
memory_order_relaxed
);
bytes
=
other
.
bytes
.
load
(
std
::
memory_order_relaxed
);
total_rows
=
other
.
total_rows
.
load
(
std
::
memory_order_relaxed
);
writ
e_rows
=
other
.
write
_rows
.
load
(
std
::
memory_order_relaxed
);
writ
e_bytes
=
other
.
write
_bytes
.
load
(
std
::
memory_order_relaxed
);
r
ead_rows
=
other
.
read_
rows
.
load
(
std
::
memory_order_relaxed
);
read_bytes
=
other
.
read_
bytes
.
load
(
std
::
memory_order_relaxed
);
total_rows
_to_read
=
other
.
total_rows_to_read
.
load
(
std
::
memory_order_relaxed
);
writ
ten_rows
=
other
.
written
_rows
.
load
(
std
::
memory_order_relaxed
);
writ
ten_bytes
=
other
.
written
_bytes
.
load
(
std
::
memory_order_relaxed
);
return
*
this
;
}
...
...
dbms/src/Interpreters/ProcessList.cpp
浏览文件 @
77b7158c
...
...
@@ -400,11 +400,13 @@ QueryStatusInfo QueryStatus::getInfo(bool get_thread_list, bool get_profile_even
res
.
client_info
=
client_info
;
res
.
elapsed_seconds
=
watch
.
elapsedSeconds
();
res
.
is_cancelled
=
is_killed
.
load
(
std
::
memory_order_relaxed
);
res
.
read_rows
=
progress_in
.
rows
;
res
.
read_bytes
=
progress_in
.
bytes
;
res
.
total_rows
=
progress_in
.
total_rows
;
res
.
written_rows
=
progress_out
.
rows
;
res
.
written_bytes
=
progress_out
.
bytes
;
res
.
read_rows
=
progress_in
.
read_rows
;
res
.
read_bytes
=
progress_in
.
read_bytes
;
res
.
total_rows
=
progress_in
.
total_rows_to_read
;
/// TODO: Use written_rows and written_bytes when real time progress is implemented
res
.
written_rows
=
progress_out
.
read_rows
;
res
.
written_bytes
=
progress_out
.
read_bytes
;
if
(
thread_group
)
{
...
...
dbms/src/Interpreters/ThreadStatusExt.cpp
浏览文件 @
77b7158c
...
...
@@ -154,10 +154,12 @@ void ThreadStatus::logToQueryThreadLog(QueryThreadLog & thread_log)
elem
.
query_start_time
=
query_start_time
;
elem
.
query_duration_ms
=
(
getCurrentTimeNanoseconds
()
-
query_start_time_nanoseconds
)
/
1000000U
;
elem
.
read_rows
=
progress_in
.
rows
.
load
(
std
::
memory_order_relaxed
);
elem
.
read_bytes
=
progress_in
.
bytes
.
load
(
std
::
memory_order_relaxed
);
elem
.
written_rows
=
progress_out
.
rows
.
load
(
std
::
memory_order_relaxed
);
elem
.
written_bytes
=
progress_out
.
bytes
.
load
(
std
::
memory_order_relaxed
);
elem
.
read_rows
=
progress_in
.
read_rows
.
load
(
std
::
memory_order_relaxed
);
elem
.
read_bytes
=
progress_in
.
read_bytes
.
load
(
std
::
memory_order_relaxed
);
/// TODO: Use written_rows and written_bytes when run time progress is implemented
elem
.
written_rows
=
progress_out
.
read_rows
.
load
(
std
::
memory_order_relaxed
);
elem
.
written_bytes
=
progress_out
.
read_bytes
.
load
(
std
::
memory_order_relaxed
);
elem
.
memory_usage
=
memory_tracker
.
get
();
elem
.
peak_memory_usage
=
memory_tracker
.
getPeak
();
...
...
dbms/src/Interpreters/executeQuery.cpp
浏览文件 @
77b7158c
...
...
@@ -336,8 +336,8 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
if
(
auto
counting_stream
=
dynamic_cast
<
const
CountingBlockOutputStream
*>
(
stream_out
))
{
/// NOTE: Redundancy. The same values could be extracted from process_list_elem->progress_out.query_settings = process_list_elem->progress_in
elem
.
result_rows
=
counting_stream
->
getProgress
().
rows
;
elem
.
result_bytes
=
counting_stream
->
getProgress
().
bytes
;
elem
.
result_rows
=
counting_stream
->
getProgress
().
r
ead_r
ows
;
elem
.
result_bytes
=
counting_stream
->
getProgress
().
read_
bytes
;
}
}
...
...
dbms/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp
浏览文件 @
77b7158c
...
...
@@ -494,17 +494,17 @@ public:
void
operator
()
(
const
Progress
&
value
)
{
ProfileEvents
::
increment
(
ProfileEvents
::
MergedUncompressedBytes
,
value
.
bytes
);
ProfileEvents
::
increment
(
ProfileEvents
::
MergedUncompressedBytes
,
value
.
read_
bytes
);
if
(
stage
.
is_first
)
ProfileEvents
::
increment
(
ProfileEvents
::
MergedRows
,
value
.
rows
);
ProfileEvents
::
increment
(
ProfileEvents
::
MergedRows
,
value
.
r
ead_r
ows
);
updateWatch
();
merge_entry
->
bytes_read_uncompressed
+=
value
.
bytes
;
merge_entry
->
bytes_read_uncompressed
+=
value
.
read_
bytes
;
if
(
stage
.
is_first
)
merge_entry
->
rows_read
+=
value
.
rows
;
merge_entry
->
rows_read
+=
value
.
r
ead_r
ows
;
stage
.
total_rows
+=
value
.
total_rows
;
stage
.
rows_read
+=
value
.
rows
;
stage
.
total_rows
+=
value
.
total_rows
_to_read
;
stage
.
rows_read
+=
value
.
r
ead_r
ows
;
if
(
stage
.
total_rows
>
0
)
{
merge_entry
->
progress
.
store
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录