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

access log: added new START_TIME_LOCAL & EMIT_TIME_LOCAL command #35280

Merged
merged 6 commits into from
Jul 31, 2024

Conversation

doujiang24
Copy link
Member

Commit Message: access log: added new START_TIME_LOCAL & EMIT_TIME_LOCAL command
Additional Description:

Same as START_TIME & EMIT_TIME, but use local time zone.

close #35116

Risk Level: low.
Testing: unit.
Docs Changes: added.
Release Notes: TODO.
Platform Specific Features: n/a.

@doujiang24
Copy link
Member Author

PTAL cc @wbpcode Thanks.

@wbpcode
Copy link
Member

wbpcode commented Jul 24, 2024

In order to review this PR, we check the code of DataFormatter and find a bug. See #35404

I will inclined to fix that bug first. And I think it will simply this PR.

/wait-any

Copy link
Member

@wbpcode wbpcode left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. And please also provide the comparation of the speed test results between the old implementation and the new one.

source/common/common/utility.cc Outdated Show resolved Hide resolved
source/common/common/utility.h Outdated Show resolved Hide resolved
source/common/common/utility.h Outdated Show resolved Hide resolved
source/common/common/utility.h Outdated Show resolved Hide resolved
source/common/common/utility.cc Outdated Show resolved Hide resolved
@wbpcode
Copy link
Member

wbpcode commented Jul 26, 2024

/wait

Signed-off-by: doujiang24 <[email protected]>
Signed-off-by: doujiang24 <[email protected]>
@doujiang24
Copy link
Member Author

@wbpcode Thanks and sorry for the late.

Here are the benchmark results:

---------------------------------------------------------------------------------------------
Benchmark                                                   Time             CPU   Iterations
---------------------------------------------------------------------------------------------
# old
bmAccessLogDateTimeFormatter_stddev             252 ns          227 ns       100000
bmDateTimeFormatterWithSubseconds_stddev        193 ns          114 ns       100000

# new
bmAccessLogDateTimeFormatter_stddev             261 ns          233 ns       100000
bmDateTimeFormatterWithSubseconds_stddev        182 ns          114 ns       100000

Copy link
Member

@wbpcode wbpcode left a comment

Choose a reason for hiding this comment

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

Thanks for the update. It's near there. Some comments are added.

And you may could add a simple speed test in the utility_speed_test.cc for the AccessLogDateTimeFormatter::fromTime with local time zone.
(I guess it won't bring much effect because there is only some additional bool check, but this is a performance sensitive feature anyway, a test would be better)

source/extensions/filters/network/mongo_proxy/proxy.cc Outdated Show resolved Hide resolved
source/common/formatter/stream_info_formatter.h Outdated Show resolved Hide resolved
test/common/common/utility_test.cc Outdated Show resolved Hide resolved
Signed-off-by: doujiang24 <[email protected]>
@wbpcode wbpcode merged commit 3761d87 into envoyproxy:main Jul 31, 2024
51 checks passed
@wbpcode
Copy link
Member

wbpcode commented Jul 31, 2024

LGTM. Thanks.

@doujiang24 doujiang24 deleted the time-local branch August 3, 2024 13:02
martinduke pushed a commit to martinduke/envoy that referenced this pull request Aug 8, 2024
…oyproxy#35280)

Commit Message: access log: added new START_TIME_LOCAL & EMIT_TIME_LOCAL
command
Additional Description:

Same as START_TIME & EMIT_TIME, but use local time zone.

close envoyproxy#35116

Risk Level: low.
Testing: unit.
Docs Changes: added.
Release Notes: TODO.
Platform Specific Features: n/a.

---------

Signed-off-by: doujiang24 <[email protected]>
Signed-off-by: Martin Duke <[email protected]>
asingh-g pushed a commit to asingh-g/envoy that referenced this pull request Aug 20, 2024
…oyproxy#35280)

Commit Message: access log: added new START_TIME_LOCAL & EMIT_TIME_LOCAL
command
Additional Description:

Same as START_TIME & EMIT_TIME, but use local time zone.

close envoyproxy#35116

Risk Level: low.
Testing: unit.
Docs Changes: added.
Release Notes: TODO.
Platform Specific Features: n/a.

---------

Signed-off-by: doujiang24 <[email protected]>
Signed-off-by: asingh-g <[email protected]>
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.

proposal: introduce START_TIME_LOCAL and EMIT_TIME_LOCAL for local time zone in access_log
2 participants