Skip to content

Conversation

@lingbin
Copy link
Contributor

@lingbin lingbin commented Nov 3, 2025

Velox has already removed folly::StringPiece in its Counters.h, this
should be followed up in presto_cpp to reduce inconsistencies.

X-link: facebookincubator/velox#15266

== NO RELEASE NOTE ==

@lingbin lingbin requested review from a team as code owners November 3, 2025 11:41
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 3, 2025

Reviewer's Guide

Replaced folly::StringPiece with std::string_view in Counters.h by swapping the include directive and updating all counter constant declarations accordingly.

Class diagram for updated counter constant types in Counters.h

classDiagram
class facebook_presto_Counters {
  <<namespace>>
  +void registerPrestoMetrics()
  +constexpr std::string_view kCounterDriverCPUExecutorQueueSize
  +constexpr std::string_view kCounterDriverCPUExecutorLatencyMs
  +constexpr std::string_view kCounterSpillerExecutorQueueSize
  +constexpr std::string_view kCounterSpillerExecutorLatencyMs
  +constexpr std::string_view kCounterHTTPExecutorLatencyMs
  +constexpr std::string_view kCounterNumHTTPRequest
  +constexpr std::string_view kCounterNumHTTPRequestError
  +constexpr std::string_view kCounterHTTPRequestLatencyMs
  +constexpr std::string_view kCounterHttpClientNumConnectionsCreated
  +constexpr std::string_view kCounterHTTPClientTransactionCreateDelay
  +constexpr std::string_view kCounterExchangeSourcePeakQueuedBytes
  +constexpr std::string_view kCounterExchangeRequestDuration
  +constexpr std::string_view kCounterExchangeRequestNumTries
  +constexpr std::string_view kCounterExchangeRequestPageSize
  +constexpr std::string_view kCounterExchangeGetDataSizeDuration
  +constexpr std::string_view kCounterExchangeGetDataSizeNumTries
  +constexpr std::string_view kCounterNumQueryContexts
  +constexpr std::string_view kCounterMemoryManagerTotalBytes
  +constexpr std::string_view kCounterNumTasks
  +constexpr std::string_view kCounterNumTasksBytesProcessed
  +constexpr std::string_view kCounterNumTasksRunning
  +constexpr std::string_view kCounterNumTasksFinished
  +constexpr std::string_view kCounterNumTasksCancelled
  +constexpr std::string_view kCounterNumTasksAborted
  +constexpr std::string_view kCounterNumTasksFailed
  +constexpr std::string_view kCounterNumTasksPlanned
  +constexpr std::string_view kCounterNumTasksQueued
  +constexpr std::string_view kCounterNumZombieVeloxTasks
  +constexpr std::string_view kCounterNumZombiePrestoTasks
  +constexpr std::string_view kCounterNumTasksWithStuckOperator
  +constexpr std::string_view kCounterNumCancelledTasksByStuckDriver
  +constexpr std::string_view kCounterNumTasksDeadlock
  +constexpr std::string_view kCounterNumTaskManagerLockTimeOut
  +constexpr std::string_view kCounterNumQueuedDrivers
  +constexpr std::string_view kCounterNumOnThreadDrivers
  +constexpr std::string_view kCounterNumSuspendedDrivers
  +constexpr std::string_view kCounterNumBlockedWaitForConsumerDrivers
  +constexpr std::string_view kCounterNumBlockedWaitForSplitDrivers
  +constexpr std::string_view kCounterNumBlockedWaitForProducerDrivers
  +constexpr std::string_view kCounterNumBlockedWaitForJoinBuildDrivers
  +constexpr std::string_view kCounterNumBlockedWaitForJoinProbeDrivers
  +constexpr std::string_view kCounterNumBlockedWaitForMergeJoinRightSideDrivers
  +constexpr std::string_view kCounterNumBlockedWaitForMemoryDrivers
  +constexpr std::string_view kCounterNumBlockedWaitForConnectorDrivers
  +constexpr std::string_view kCounterNumBlockedYieldDrivers
  +constexpr std::string_view kCounterNumStuckDrivers
  +constexpr std::string_view kCounterOverloadedMem
  +constexpr std::string_view kCounterOverloadedCpu
  +constexpr std::string_view kCounterOverloaded
  +constexpr std::string_view kCounterTaskPlannedTimeMs
  +constexpr std::string_view kCounterTotalPartitionedOutputBuffer
  +constexpr std::string_view kCounterPartitionedOutputBufferGetDataLatencyMs
  +constexpr std::string_view kCounterOsUserCpuTimeMicros
  +constexpr std::string_view kCounterOsSystemCpuTimeMicros
  +constexpr std::string_view kCounterOsNumSoftPageFaults
  +constexpr std::string_view kCounterOsNumHardPageFaults
  +constexpr std::string_view kCounterOsNumVoluntaryContextSwitches
  +constexpr std::string_view kCounterOsNumForcedContextSwitches
  +constexpr std::string_view kCounterExchangeIoEvbViolation
  +constexpr std::string_view kCounterHttpServerIoEvbViolation
  +constexpr std::string_view kCounterMemoryPushbackCount
  +constexpr std::string_view kCounterMemoryPushbackLatencyMs
  +constexpr std::string_view kCounterMemoryPushbackReductionBytes
  +constexpr std::string_view kCounterMemoryPushbackExpectedReductionBytes
}
Loading

Class diagram for type change from folly::StringPiece to std::string_view

classDiagram
class folly_StringPiece {
  <<removed usage>>
}
class std_string_view {
  <<added usage>>
}
facebook_presto_Counters ..> std_string_view : uses
Loading

File-Level Changes

Change Details Files
Use std::string_view instead of folly::StringPiece for counter constants
  • Swap include from folly/Range.h to <string_view>
  • Update all constexpr counter declarations to std::string_view
presto-native-execution/presto_cpp/main/common/Counters.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@lingbin
Copy link
Contributor Author

lingbin commented Nov 3, 2025

@amitkdutta Could you help review this PR? Thanks.

Copy link
Contributor

@PingLiuPing PingLiuPing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants