Skip to content

Commit

Permalink
[Code health] Remove Unicode Text from Source files (#2707)
Browse files Browse the repository at this point in the history
Signed-off-by: perhapsmaple <[email protected]>
  • Loading branch information
perhapsmaple authored Jun 20, 2024
1 parent aff26ac commit e1d9690
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion api/include/opentelemetry/baggage/baggage.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright The OpenTelemetry Authors
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/context/context.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright The OpenTelemetry Authors
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/context/runtime_context.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright The OpenTelemetry Authors
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion ext/test/http/url_parser_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ TEST(UrlDecoderTests, BasicTests)
std::map<std::string, std::string> testdata{
{"Authentication=Basic xxx", "Authentication=Basic xxx"},
{"Authentication=Basic%20xxx", "Authentication=Basic xxx"},
{"%C3%B6%C3%A0%C2%A7%C3%96abcd%C3%84", "öà§ÖabcdÄ"},
{"%C3%B6%C3%A0%C2%A7%C3%96abcd%C3%84",
"\xc3\xb6\xc3\xa0\xc2\xa7\xc3\x96\x61\x62\x63\x64\xc3\x84"},
{"%2x", "%2x"},
{"%20", " "},
{"text%2", "text%2"},
Expand Down
2 changes: 1 addition & 1 deletion opentracing-shim/src/span_shim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void SpanShim::Log(opentracing::SystemTime timestamp,
void SpanShim::logImpl(nostd::span<const EventEntry> fields,
const opentracing::SystemTime *const timestamp) noexcept
{
// The Add Events name parameter MUST be the value with the event key
// The Add Event's name parameter MUST be the value with the event key
// in the pair set, or else fallback to use the log literal string.
const auto &event = std::find_if(fields.begin(), fields.end(),
[](const EventEntry &item) { return item.first == "event"; });
Expand Down
10 changes: 5 additions & 5 deletions sdk/test/metrics/instrument_metadata_validator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ TEST(InstrumentMetadataValidator, TestName)
{
opentelemetry::sdk::metrics::InstrumentMetaDataValidator validator;
std::vector<std::string> invalid_names = {
"", // empty string
"1sdf", // string starting with number
"123€AAA€BBB", // unicode characters
"", // empty string
"1sdf", // string starting with number
"\x31\x32\x33\xe2\x82\xac\x41\x41\x41\xe2\x82\xac\x42\x42\x42" // unicode characters
"/\\sdsd", // string starting with special character
"***sSSs", // string starting with special character
"a\\broken\\path", // contains backward slash
CreateVeryLargeString(25) + "X", // total 256 characters
CreateVeryLargeString(26), // string much bigger than 255 characters
CreateVeryLargeString(26), // string much bigger than 255 character
};
for (auto const &str : invalid_names)
{
Expand Down Expand Up @@ -56,7 +56,7 @@ TEST(InstrumentMetadataValidator, TestUnit)
std::vector<std::string> invalid_units = {
CreateVeryLargeString(5) + "ABCERTYGJ", // total 64 charactes
CreateVeryLargeString(7), // string bigger than 63 chars
"123€AAA€BBB", // unicode string
"\x31\x32\x33\xe2\x82\xac\x41\x41\x41\xe2\x82\xac\x42\x42\x42", // unicode string
};
for (auto const &str : invalid_units)
{
Expand Down

1 comment on commit e1d9690

@github-actions
Copy link

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: e1d9690 Previous: aff26ac Ratio
BM_ProcYieldSpinLockThrashing/1/process_time/real_time 0.296858549118042 ms/iter 0.09384435407655602 ms/iter 3.16
BM_ProcYieldSpinLockThrashing/2/process_time/real_time 0.5839322742662931 ms/iter 0.18162207725720528 ms/iter 3.22
BM_ProcYieldSpinLockThrashing/4/process_time/real_time 1.581035057703654 ms/iter 0.7245256493128643 ms/iter 2.18
BM_NaiveSpinLockThrashing/1/process_time/real_time 0.25830602645874023 ms/iter 0.09800373822793193 ms/iter 2.64

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.