-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[native] Move static functions from PrestoTask to Util. #22617
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
#include "presto_cpp/main/TaskResource.h" | ||
#include <presto_cpp/main/common/Exception.h> | ||
#include "presto_cpp/main/common/Configs.h" | ||
#include "presto_cpp/main/common/Utils.h" | ||
#include "presto_cpp/main/thrift/ProtocolToThrift.h" | ||
#include "presto_cpp/main/thrift/ThriftIO.h" | ||
#include "presto_cpp/main/thrift/gen-cpp2/PrestoThrift.h" | ||
|
@@ -220,7 +221,7 @@ proxygen::RequestHandler* TaskResource::createOrUpdateTaskImpl( | |
folly::via( | ||
httpSrvCpuExecutor_, | ||
[this, &body, taskId, createOrUpdateFunc]() { | ||
const auto startProcessCpuTime = PrestoTask::getProcessCpuTime(); | ||
const auto startProcessCpuTime = util::getProcessCpuTime(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
// TODO Avoid copy | ||
std::ostringstream oss; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,9 @@ std::shared_ptr<folly::SSLContext> createSSLContext( | |
const std::string& clientCertAndKeyPath, | ||
const std::string& ciphers); | ||
|
||
/// Returns process-wide CPU time in nanoseconds. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to avoid files / classes named Util as they tend to become a "dumping ground" for lots of unrelated code. It would be better to come with more specific names. |
||
long getProcessCpuTime(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
std::string taskNumbersToString(const std::array<size_t, 5>& taskNumbers); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
} // namespace facebook::presto::util |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to keep this as static method of PrestoTask as the states are specific to PrestoTask internal
s/taskNumbersToString/taskStatesToString/