-
Notifications
You must be signed in to change notification settings - Fork 374
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
impl(storage): helper class to generate invocation ids #9484
impl(storage): helper class to generate invocation ids #9484
Conversation
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Codecov Report
@@ Coverage Diff @@
## main #9484 +/- ##
=======================================
Coverage 94.62% 94.63%
=======================================
Files 1486 1488 +2
Lines 137065 137126 +61
=======================================
+ Hits 129700 129767 +67
+ Misses 7365 7359 -6
Continue to review full report at Codecov.
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
We will be adding telemetry to GCS requests, where all the retry attempts for the same application call will share an "invocation id". This will be included in the `x-goog-api-client` header, under the `gccl-invocation-id/` field. The design doc calls for a very specific format for these ids, which this helper class generates.
9b2b2e9
to
b55ce90
Compare
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
auto constexpr kIdBitCount = 128; | ||
auto constexpr kArraySize = kIdBitCount / 8; | ||
std::array<std::uint8_t, kArraySize> buf; | ||
std::uniform_int_distribution<std::uint8_t> d(0, 255); |
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.
I'm seeing a static assertion failure with a platform of interest.
static_assert(__libcpp_random_is_valid_inttype<_IntType>::value, "IntType must be an integer type larger than char");
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.
For what it's worth, cppreference says ...
"IntType - The result type generated by the generator. The effect is undefined if this is not one of short, int, long, long long, unsigned short, unsigned int, unsigned long, or unsigned long long."
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.
Blegh. Okay, we can use int
and cast to the desired result. The output should be in range. I can send a PR, but I need to dig myself from all the upgrade PRs that are breaking things right now.
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.
See #9509. Let's see what the builds say.
We will be adding telemetry to GCS requests, where all the retry
attempts for the same application call will share an "invocation id".
This will be included in the
x-goog-api-client
header, under thegccl-invocation-id/
field. The design doc calls for a very specificformat for these ids, which this helper class generates.
This change is