]> git.ipfire.org Git - thirdparty/squid.git/commit - src/time.cc
Logging fast things
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 20 Nov 2014 08:57:14 +0000 (10:57 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 20 Nov 2014 08:57:14 +0000 (10:57 +0200)
commit01bd87d861361032aeb9f8bfda938581bfa43101
tree65331a1bcb1293c5d9597b4d1deb88bed8749f7e
parent6b52d3cdbdd10a3e675cdf0e07094f4954a3da9c
Logging fast things

In many cases HITs logged with zero response times. The logging entries are
correct, those transaction took less than a millisecond. However, to better
monitor Squid performance and to optimize things further, a user may want to
see more precise response time measurements logged.

Squid already computes response times with microsecond resolution
(timeval::tv_usec), which would be enough for any modern measurement, but
Squid loses that precision due to tvSubMs conversion.

This patch add configurable "precision" for time-related fields such as %tr,
using a .n syntax similar to the syntax used by the well-known printf(3) API
to mean "maximum field width".

Examples:
  %tr   -- 0 -- millisecond precision (no change compared to today)
  %.3tr -- 0.123 -- microsecond precision (after this project)
  %.6tr -- 0.123456 -- nanosecond precision (year 2050 trading platform??)

This is a Measurement Factory project
17 files changed:
src/AccessLogEntry.h
src/HierarchyLogEntry.h
src/SquidTime.h
src/adaptation/icap/History.cc
src/adaptation/icap/History.h
src/adaptation/icap/Xaction.cc
src/client_side.cc
src/format/Format.cc
src/format/Token.cc
src/htcp.cc
src/http.cc
src/icp_v2.cc
src/log/FormatSquidIcap.cc
src/log/FormatSquidNative.cc
src/log/access_log.cc
src/neighbors.cc
src/time.cc