MCPcopy Create free account
hub / github.com/apache/trafficserver / canLogError

Method canLogError

plugins/slice/Config.cc:298–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298bool
299Config::canLogError()
300{
301 if (m_paceerrsecs < 0) {
302 return false;
303 } else if (0 == m_paceerrsecs) {
304 return true;
305 }
306
307#if !defined(UNITTEST)
308 TSHRTime const timenow = TShrtime();
309#endif
310
311 std::lock_guard<std::mutex> const guard(m_mutex);
312
313#if !defined(UNITTEST)
314 if (timenow < m_nextlogtime) {
315 return false;
316 }
317
318 m_nextlogtime = timenow + TS_HRTIME_SECONDS(m_paceerrsecs);
319#else
320 m_nextlogtime = 0; // needed by clang
321#endif
322
323 return true;
324}
325
326bool
327Config::matchesRegex(char const *const url, int const urllen) const

Callers 1

logSliceErrorFunction · 0.80

Calls 1

TShrtimeFunction · 0.85

Tested by

no test coverage detected