From 2a9feb82b55481308c0f6aa9d813e9021b0333ef Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Thu, 5 May 2022 01:59:46 -0400 Subject: Upgraded RPM Calculation Support (Take 1) This patch begins the work on updated RPM calculations using the httptrace infrastructure. Because we are still not able to break out the TLS handshake time due to upstream bugs, there are some workarounds in place. However, the numbers appear much more sane. --- debug/debug.go | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 debug/debug.go (limited to 'debug/debug.go') diff --git a/debug/debug.go b/debug/debug.go new file mode 100644 index 0000000..2a3df4a --- /dev/null +++ b/debug/debug.go @@ -0,0 +1,35 @@ +package debug + +type DebugLevel int8 + +const ( + NoDebug DebugLevel = iota + Debug + Warn + Error +) + +type DebugWithPrefix struct { + Level DebugLevel + Prefix string +} + +func NewDebugWithPrefix(level DebugLevel, prefix string) *DebugWithPrefix { + return &DebugWithPrefix{Level: level, Prefix: prefix} +} + +func (d *DebugWithPrefix) String() string { + return d.Prefix +} + +func IsDebug(level DebugLevel) bool { + return level <= Debug +} + +func IsWarn(level DebugLevel) bool { + return level <= Warn +} + +func IsError(level DebugLevel) bool { + return level <= Error +} -- cgit v1.2.3