You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: Ability to specify unit/precision of access log duration
Description:
Durations are hard-coded to milliseconds, it would be super convenient to be able to specify the unit i.e. seconds so that 3 milliseconds is logged as 0.003. Additionally, from the code, it appears that the duration is stored using chrono::nanoseconds so it shouldn't be difficult to provide precision control from ns and up (our previous system provides ns precision and we're working for on-par drop-in replacement for logging). An example of the final result is that someone could specify seconds-unit but with nanosecond precision.
Somewhat related to issue #2709 - I'm willing to provide an implementation.
The text was updated successfully, but these errors were encountered:
This change adds %f, %[1-9]f specifier to get subseconds for START_TIME.
As an example, START_TIME(%s%3f) gets a timestamp in milliseconds.
This also adds START_TIME as one of the supported variables in header formatter.
Risk Level: Low, since this is an optional feature.
Testing: unit and manual tests.
Docs Changes:
added subsecond specifier for START_TIME for both access_log and router header formatter.
added START_TIME as one of the supported variables in header formatter.
Release Notes:
added subsecond specifier for START_TIME for both access_log and router header formatter.
added START_TIME as one of the supported variables in header formatter.
Fixes#1966Fixes#2877
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
@htuch does this only apply to START_TIME, or can I use this mechanism to format other duration entries too? looking at the docs it only seems to specify that we can format START_TIME
Title: Ability to specify unit/precision of access log duration
Description:
Durations are hard-coded to milliseconds, it would be super convenient to be able to specify the unit i.e. seconds so that
3
milliseconds is logged as0.003
. Additionally, from the code, it appears that the duration is stored usingchrono::nanoseconds
so it shouldn't be difficult to provide precision control fromns
and up (our previous system provides ns precision and we're working for on-par drop-in replacement for logging). An example of the final result is that someone could specify seconds-unit but with nanosecond precision.Somewhat related to issue #2709 - I'm willing to provide an implementation.
The text was updated successfully, but these errors were encountered: