Skip to content

Commit

Permalink
Revert "add time print in transform"
Browse files Browse the repository at this point in the history
This reverts commit 401d6ec.
  • Loading branch information
liuneng1994 committed Apr 13, 2022
1 parent a1c4e68 commit 43acb9b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 22 deletions.
10 changes: 1 addition & 9 deletions src/Processors/ISimpleTransform.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <Processors/ISimpleTransform.h>
#include <Common/Stopwatch.h>
#include <common/logger_useful.h>


namespace DB
{
Expand Down Expand Up @@ -53,9 +52,6 @@ ISimpleTransform::Status ISimpleTransform::prepare()
{
if (input.isFinished())
{
LOG_DEBUG(&Poco::Logger::get(getName()),
"Processor {} used {} ms\n",
getName(), time/ 1000000UL);
output.finish();
return Status::Finished;
}
Expand Down Expand Up @@ -90,11 +86,7 @@ void ISimpleTransform::work()

try
{
Stopwatch watch;
watch.start();
transform(input_data.chunk, output_data.chunk);
time += watch.elapsedNanoseconds();
watch.stop();
}
catch (DB::Exception &)
{
Expand Down
1 change: 0 additions & 1 deletion src/Processors/ISimpleTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class ISimpleTransform : public IProcessor
bool has_output = false;
bool no_more_data_needed = false;
const bool skip_empty_chunks;
UInt64 time = 0;

/// Set input port NotNeeded after chunk was pulled.
/// Input port will become needed again only after data was transformed.
Expand Down
12 changes: 1 addition & 11 deletions src/Processors/ISource.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <Processors/ISource.h>
#include <Common/Stopwatch.h>
#include <common/logger_useful.h>


namespace DB
{
Expand Down Expand Up @@ -51,23 +50,14 @@ void ISource::work()
{
try
{
Stopwatch watch;
watch.start();
if (auto chunk = tryGenerate())
{
current_chunk.chunk = std::move(*chunk);
if (current_chunk.chunk)
has_input = true;
time += watch.elapsedNanoseconds();
}
else
{
finished = true;
LOG_DEBUG(&Poco::Logger::get(getName()),
"Processor {} used {} ms\n",
getName(), time/ 1000000UL);
}


if (isCancelled())
finished = true;
Expand Down
1 change: 0 additions & 1 deletion src/Processors/ISource.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class ISource : public IProcessor
bool finished = false;
bool got_exception = false;
Port::Data current_chunk;
UInt64 time = 0;

virtual Chunk generate();
virtual std::optional<Chunk> tryGenerate();
Expand Down

0 comments on commit 43acb9b

Please sign in to comment.