You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zzzzzzzs (via GitHub)" <gi...@apache.org> on 2023/12/21 06:50:46 UTC

[PR] [feature](profile) store profile information of be in Rocksdb [doris]

zzzzzzzs opened a new pull request, #28782:
URL: https://github.com/apache/doris/pull/28782

   ## Proposed changes
   
   store profile information of be in Rocksdb
   
   <!--Describe your changes.-->
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [feature](profile) store profile information of be in Rocksdb [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #28782:
URL: https://github.com/apache/doris/pull/28782#discussion_r1433624581


##########
be/src/olap/storage_engine.cpp:
##########
@@ -260,6 +263,25 @@ Status StorageEngine::_init_stream_load_recorder(const std::string& stream_load_
     return Status::OK();
 }
 
+Status StorageEngine::_init_profile_recorder(const std::string& profile_record_path) {

Review Comment:
   warning: method '_init_profile_recorder' can be made static [readability-convert-member-functions-to-static]
   
   ```suggestion
   static Status StorageEngine::_init_profile_recorder(const std::string& profile_record_path) {
   ```
   



##########
be/src/util/profile_recorder.cpp:
##########
@@ -0,0 +1,174 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+// This file is copied from
+// https://github.com/apache/impala/blob/branch-2.9.0/be/src/util/runtime-profile.h
+// and modified by Doris
+
+#include "profile_recorder.h"
+
+#include <glog/logging.h>
+#include <rocksdb/iterator.h>
+#include <rocksdb/status.h>
+#include <thrift/Thrift.h>
+
+#include <algorithm>
+#include <memory>
+#include <ostream>
+
+#include "common/config.h"
+#include "common/status.h"
+#include "rocksdb/convenience.h"
+#include "rocksdb/db.h"
+#include "rocksdb/options.h"
+#include "rocksdb/slice.h"
+#include "rocksdb/utilities/db_ttl.h"
+#include "util/time.h"
+
+namespace doris {
+const std::string Profile_POSTFIX = "/profile";
+
+ProfileRecorder::ProfileRecorder(const std::string& root_path)
+        : _root_path(root_path), _db(nullptr), _last_compaction_time(UnixMillis()) {}

Review Comment:
   warning: pass by value and use std::move [modernize-pass-by-value]
   
   be/src/util/profile_recorder.cpp:30:
   ```diff
   
   + #include <utility>
   ```
   
   ```suggestion
   ProfileRecorder::ProfileRecorder(std::string  root_path)
           : _root_path(std::move(root_path)), _db(nullptr), _last_compaction_time(UnixMillis()) {}
   ```
   
   be/src/util/profile_recorder.h:46:
   ```diff
   -     ProfileRecorder(const std::string& root_path);
   +     ProfileRecorder(std::string  root_path);
   ```
   



##########
be/src/util/profile_recorder.cpp:
##########
@@ -0,0 +1,174 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+// This file is copied from
+// https://github.com/apache/impala/blob/branch-2.9.0/be/src/util/runtime-profile.h
+// and modified by Doris
+
+#include "profile_recorder.h"
+
+#include <glog/logging.h>
+#include <rocksdb/iterator.h>
+#include <rocksdb/status.h>
+#include <thrift/Thrift.h>
+
+#include <algorithm>
+#include <memory>
+#include <ostream>
+
+#include "common/config.h"
+#include "common/status.h"
+#include "rocksdb/convenience.h"
+#include "rocksdb/db.h"
+#include "rocksdb/options.h"
+#include "rocksdb/slice.h"
+#include "rocksdb/utilities/db_ttl.h"
+#include "util/time.h"
+
+namespace doris {
+const std::string Profile_POSTFIX = "/profile";
+
+ProfileRecorder::ProfileRecorder(const std::string& root_path)
+        : _root_path(root_path), _db(nullptr), _last_compaction_time(UnixMillis()) {}

Review Comment:
   warning: member initializer for '_db' is redundant [modernize-use-default-member-init]
   
   ```suggestion
           : _root_path(root_path), , _last_compaction_time(UnixMillis()) {}
   ```
   



##########
be/src/util/profile_recorder.h:
##########
@@ -0,0 +1,76 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+// This file is copied from
+// https://github.com/apache/impala/blob/branch-2.9.0/be/src/util/runtime-profile.h
+// and modified by Doris
+
+#pragma once
+
+#include <stdint.h>

Review Comment:
   warning: inclusion of deprecated C++ header 'stdint.h'; consider using 'cstdint' instead [modernize-deprecated-headers]
   
   ```suggestion
   #include <cstdint>
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [feature](profile) store profile information of be in Rocksdb [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #28782:
URL: https://github.com/apache/doris/pull/28782#discussion_r1434801112


##########
be/src/util/profile_recorder.cpp:
##########
@@ -0,0 +1,174 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+// This file is copied from
+// https://github.com/apache/impala/blob/branch-2.9.0/be/src/util/runtime-profile.h
+// and modified by Doris
+
+#include "profile_recorder.h"
+
+#include <glog/logging.h>
+#include <rocksdb/iterator.h>
+#include <rocksdb/status.h>
+#include <thrift/Thrift.h>
+
+#include <algorithm>
+#include <memory>
+#include <ostream>
+
+#include "common/config.h"
+#include "common/status.h"
+#include "rocksdb/convenience.h"
+#include "rocksdb/db.h"
+#include "rocksdb/options.h"
+#include "rocksdb/slice.h"
+#include "rocksdb/utilities/db_ttl.h"
+#include "util/time.h"
+
+namespace doris {
+const std::string Profile_POSTFIX = "/profile";
+
+ProfileRecorder::ProfileRecorder(const std::string& root_path)
+        : _root_path(root_path), _last_compaction_time(UnixMillis()) {}
+

Review Comment:
   warning: pass by value and use std::move [modernize-pass-by-value]
   
   be/src/util/profile_recorder.cpp:30:
   ```diff
   
   + #include <utility>
   ```
   
   ```suggestion
   ProfileRecorder::ProfileRecorder(std::string  root_path)
           : _root_path(std::move(root_path)std::string _compaction_time(UnixMillis()) {}
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org