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

Method preproc_buffers

src/proxy/logging/LogObject.cc:67–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65} // end anonymous namespace
66
67size_t
68LogBufferManager::preproc_buffers(LogBufferSink *sink)
69{
70 SList(LogBuffer, write_link) q(write_list.popall()), new_q;
71 LogBuffer *b = nullptr;
72 while ((b = q.pop())) {
73 if (b->m_references || b->m_state.s.num_writers) {
74 // Still has outstanding references.
75 write_list.push(b);
76 } else if (_num_flush_buffers > FLUSH_ARRAY_SIZE) {
77 ink_atomic_increment(&_num_flush_buffers, -1);
78 Warning("Dropping log buffer, can't keep up.");
79 Metrics::Counter::increment(log_rsb.bytes_lost_before_preproc, b->header()->byte_count);
80 delete b;
81 } else {
82 new_q.push(b);
83 }
84 }
85
86 int prepared = 0;
87 while ((b = new_q.pop())) {
88 b->update_header_data();
89 sink->preproc_and_try_delete(b);
90 ink_atomic_increment(&_num_flush_buffers, -1);
91 prepared++;
92 }
93
94 Dbg(dbg_ctl_log_logbuffer, "prepared %d buffers", prepared);
95 return prepared;
96}
97
98/*-------------------------------------------------------------------------
99 LogObject

Callers 1

preproc_thread_mainMethod · 0.45

Calls 8

ink_atomic_incrementFunction · 0.85
incrementFunction · 0.85
popallMethod · 0.80
update_header_dataMethod · 0.80
popMethod · 0.45
pushMethod · 0.45
headerMethod · 0.45

Tested by

no test coverage detected