Skip to content
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

Draft xxx #24695

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions presto-native-execution/presto_cpp/main/common/Counters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,39 @@ void registerPrestoMetrics() {
90,
99,
100);
// Tracks http client transaction create delay in range of [0, 250] with
// 50 buckets and reports P50, P90, P99, and P100.
DEFINE_HISTOGRAM_METRIC(
kCounterHTTPClientNumIdleSessions,
5,
0,
250,
50,
90,
99,
100);
// Tracks http client transaction create delay in range of [0, 250] with
// 50 buckets and reports P50, P90, P99, and P100.
DEFINE_HISTOGRAM_METRIC(
kCounterHTTPClientNumActiveNonFullSessions,
5,
0,
250,
50,
90,
99,
100);
// Tracks http client transaction create delay in range of [0, 250] with
// 50 buckets and reports P50, P90, P99, and P100.
DEFINE_HISTOGRAM_METRIC(
kCounterHTTPClientNumFullSessions,
5,
0,
250,
50,
90,
99,
100);
DEFINE_METRIC(kCounterNumQueryContexts, facebook::velox::StatType::AVG);
DEFINE_METRIC(kCounterNumTasks, facebook::velox::StatType::AVG);
DEFINE_METRIC(kCounterNumTasksBytesProcessed, facebook::velox::StatType::AVG);
Expand Down
6 changes: 6 additions & 0 deletions presto-native-execution/presto_cpp/main/common/Counters.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ constexpr folly::StringPiece kCounterHttpClientNumConnectionsCreated{
"presto_cpp.http.client.num_connections_created"};
constexpr folly::StringPiece kCounterHTTPClientTransactionCreateDelay{
"presto_cpp.http.client.transaction_create_delay_ms"};
constexpr folly::StringPiece kCounterHTTPClientNumIdleSessions{
"presto_cpp.http.client.num_idle_sessions"};
constexpr folly::StringPiece kCounterHTTPClientNumActiveNonFullSessions{
"presto_cpp.http.num_active_non_full_sessions"};
constexpr folly::StringPiece kCounterHTTPClientNumFullSessions{
"presto_cpp.http.client.num_full_sessions"};
/// Peak number of bytes queued in PrestoExchangeSource waiting for consume.
constexpr folly::StringPiece kCounterExchangeSourcePeakQueuedBytes{
"presto_cpp.exchange_source_peak_queued_bytes"};
Expand Down
9 changes: 9 additions & 0 deletions presto-native-execution/presto_cpp/main/http/HttpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,15 @@ void HttpClient::initSessionPool() {
folly::SemiFuture<proxygen::HTTPTransaction*> HttpClient::createTransaction(
proxygen::HTTPTransactionHandler* handler) {
eventBase_->dcheckIsInEventBaseThread();
RECORD_HISTOGRAM_METRIC_VALUE(
kCounterHTTPClientNumIdleSessions,
sessionPool_->getNumIdleSessions());
RECORD_HISTOGRAM_METRIC_VALUE(
kCounterHTTPClientNumActiveNonFullSessions,
sessionPool_->getNumActiveNonFullSessions());
RECORD_HISTOGRAM_METRIC_VALUE(
kCounterHTTPClientNumFullSessions,
sessionPool_->getNumFullSessions());
if (auto* txn = sessionPool_->getTransaction(handler)) {
VLOG(3) << "Reuse same thread connection to " << address_.describe();
return folly::makeSemiFuture(txn);
Expand Down
Loading