Skip to content

Commit

Permalink
update 1
Browse files Browse the repository at this point in the history
Signed-off-by: liuyehcf <[email protected]>
  • Loading branch information
liuyehcf committed Oct 30, 2023
1 parent 28731e6 commit fe44bf0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
3 changes: 0 additions & 3 deletions be/src/exec/pipeline/fragment_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ Status FragmentExecutor::_prepare_query_ctx(ExecEnv* exec_env, const UnifiedExec
if (query_options.__isset.enable_profile && query_options.enable_profile) {
_query_ctx->set_enable_profile();
}
if (query_options.__isset.enable_big_query_profile && query_options.enable_big_query_profile) {
_query_ctx->set_enable_big_query_profile();
}
if (query_options.__isset.big_query_profile_second_threshold) {
_query_ctx->set_big_query_profile_threshold(query_options.big_query_profile_second_threshold);
}
Expand Down
6 changes: 2 additions & 4 deletions be/src/exec/pipeline/query_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@ class QueryContext : public std::enable_shared_from_this<QueryContext> {
duration_cast<milliseconds>(steady_clock::now().time_since_epoch() + _query_expire_seconds).count();
}
void set_enable_profile() { _enable_profile = true; }
void set_enable_big_query_profile() { _enable_big_query_profile = true; }
bool enable_profile() {
if (_enable_profile) {
return true;
}
if (!_enable_big_query_profile) {
if (_big_query_profile_threshold_ns <= 0) {
return false;
}
return MonotonicNanos() - _query_begin_time > _big_query_profile_threshold_ns;
Expand Down Expand Up @@ -214,8 +213,7 @@ class QueryContext : public std::enable_shared_from_this<QueryContext> {
std::once_flag _init_mem_tracker_once;
std::shared_ptr<RuntimeProfile> _profile;
bool _enable_profile = false;
bool _enable_big_query_profile = false;
int64_t _big_query_profile_threshold_ns;
int64_t _big_query_profile_threshold_ns = 0;
int64_t _runtime_profile_report_interval_ns = std::numeric_limits<int64_t>::max();
TPipelineProfileLevel::type _profile_level;
std::shared_ptr<MemTracker> _mem_tracker;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ public static MaterializedViewRewriteMode parse(String str) {
public static final String BIG_QUERY_LOG_CPU_SECOND_THRESHOLD = "big_query_log_cpu_second_threshold";
public static final String BIG_QUERY_LOG_SCAN_BYTES_THRESHOLD = "big_query_log_scan_bytes_threshold";
public static final String BIG_QUERY_LOG_SCAN_ROWS_THRESHOLD = "big_query_log_scan_rows_threshold";
public static final String ENABLE_BIG_QUERY_PROFILE = "enable_big_query_profile";
public static final String BIG_QUERY_PROFILE_SECOND_THRESHOLD = "big_query_profile_second_threshold";

public static final String SQL_DIALECT = "sql_dialect";
Expand Down Expand Up @@ -849,11 +848,8 @@ public static MaterializedViewRewriteMode parse(String str) {
@VariableMgr.VarAttr(name = ENABLE_ASYNC_PROFILE, flag = VariableMgr.INVISIBLE)
private boolean enableAsyncProfile = true;

@VariableMgr.VarAttr(name = ENABLE_BIG_QUERY_PROFILE)
private boolean enableBigQueryProfile = false;

@VariableMgr.VarAttr(name = BIG_QUERY_PROFILE_SECOND_THRESHOLD)
private int bigQueryProfileSecondThreshold = 30;
private int bigQueryProfileSecondThreshold = 0;

@VariableMgr.VarAttr(name = RESOURCE_GROUP_ID, alias = RESOURCE_GROUP_ID_V2,
show = RESOURCE_GROUP_ID_V2, flag = VariableMgr.INVISIBLE)
Expand Down Expand Up @@ -1662,7 +1658,7 @@ public void setEnableLoadProfile(boolean enableLoadProfile) {
}

public boolean isEnableBigQueryProfile() {
return enableBigQueryProfile;
return bigQueryProfileSecondThreshold > 0;
}

public int getBigQueryProfileSecondThreshold() {
Expand Down Expand Up @@ -2794,7 +2790,6 @@ public TQueryOptions toThrift() {
tResult.setQuery_timeout(Math.min(Integer.MAX_VALUE / 1000, queryTimeoutS));
tResult.setQuery_delivery_timeout(Math.min(Integer.MAX_VALUE / 1000, queryDeliveryTimeoutS));
tResult.setEnable_profile(enableProfile);
tResult.setEnable_big_query_profile(enableBigQueryProfile);
tResult.setBig_query_profile_second_threshold(bigQueryProfileSecondThreshold);
tResult.setRuntime_profile_report_interval(runtimeProfileReportInterval);
tResult.setBatch_size(chunkSize);
Expand Down
3 changes: 1 addition & 2 deletions gensrc/thrift/InternalService.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ struct TQueryOptions {
107: optional i64 global_runtime_filter_build_max_size;
108: optional i64 runtime_filter_rpc_http_min_size;

109: optional bool enable_big_query_profile;
110: optional i64 big_query_profile_second_threshold;
109: optional i64 big_query_profile_second_threshold;
}


Expand Down

0 comments on commit fe44bf0

Please sign in to comment.