diff options
author | Håvard Pettersen <havardpe@oath.com> | 2018-09-04 09:07:57 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2018-09-04 09:07:57 +0000 |
commit | baed1940fe53ca0af17e75d4dfd3efe1c98802db (patch) | |
tree | b6a380f90b22ce3f9deda135f877638459da2b31 /fnet/src | |
parent | 5f4033fccbed3ca6b9b73459cc14ee33c86ebf97 (diff) |
remove io stats tracking and logging
Diffstat (limited to 'fnet/src')
-rw-r--r-- | fnet/src/examples/proxy/proxy.cpp | 1 | ||||
-rw-r--r-- | fnet/src/tests/info/info.cpp | 4 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/CMakeLists.txt | 1 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/config.cpp | 6 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/config.h | 2 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/connection.cpp | 46 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/connection.h | 3 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/fnet.h | 3 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/iocomponent.cpp | 1 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/iocomponent.h | 44 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/stats.cpp | 98 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/stats.h | 103 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/transport.cpp | 8 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/transport.h | 8 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/transport_thread.cpp | 38 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/transport_thread.h | 73 |
16 files changed, 20 insertions, 419 deletions
diff --git a/fnet/src/examples/proxy/proxy.cpp b/fnet/src/examples/proxy/proxy.cpp index 653b445581f..a01a16ead9c 100644 --- a/fnet/src/examples/proxy/proxy.cpp +++ b/fnet/src/examples/proxy/proxy.cpp @@ -227,7 +227,6 @@ Proxy::Main() if (listener != nullptr) listener->SubRef(); - _transport.SetLogStats(true); FNET_SignalShutDown ssd(_transport); _transport.Main(); return 0; diff --git a/fnet/src/tests/info/info.cpp b/fnet/src/tests/info/info.cpp index f22c1402437..ecd21a7bd25 100644 --- a/fnet/src/tests/info/info.cpp +++ b/fnet/src/tests/info/info.cpp @@ -70,10 +70,10 @@ TEST("info") { TEST("size of important objects") { - EXPECT_EQUAL(176u, sizeof(FNET_IOComponent)); + EXPECT_EQUAL(168u, sizeof(FNET_IOComponent)); EXPECT_EQUAL(32u, sizeof(FNET_Channel)); EXPECT_EQUAL(40u, sizeof(FNET_PacketQueue_NoLock)); - EXPECT_EQUAL(480u, sizeof(FNET_Connection)); + EXPECT_EQUAL(472u, sizeof(FNET_Connection)); EXPECT_EQUAL(48u, sizeof(std::condition_variable)); EXPECT_EQUAL(56u, sizeof(FNET_DataBuffer)); EXPECT_EQUAL(24u, sizeof(FastOS_Time)); diff --git a/fnet/src/vespa/fnet/CMakeLists.txt b/fnet/src/vespa/fnet/CMakeLists.txt index 20badc5c489..4b9d818e5ed 100644 --- a/fnet/src/vespa/fnet/CMakeLists.txt +++ b/fnet/src/vespa/fnet/CMakeLists.txt @@ -17,7 +17,6 @@ vespa_add_library(fnet scheduler.cpp signalshutdown.cpp simplepacketstreamer.cpp - stats.cpp task.cpp transport.cpp transport_thread.cpp diff --git a/fnet/src/vespa/fnet/config.cpp b/fnet/src/vespa/fnet/config.cpp index 7430de33bb1..a546d38f78b 100644 --- a/fnet/src/vespa/fnet/config.cpp +++ b/fnet/src/vespa/fnet/config.cpp @@ -6,6 +6,6 @@ FNET_Config::FNET_Config() : _iocTimeOut(0), _maxInputBufferSize(0x10000), _maxOutputBufferSize(0x10000), - _tcpNoDelay(true), - _logStats(false) -{ } + _tcpNoDelay(true) +{ +} diff --git a/fnet/src/vespa/fnet/config.h b/fnet/src/vespa/fnet/config.h index ffaab6714ae..3f34c1511b6 100644 --- a/fnet/src/vespa/fnet/config.h +++ b/fnet/src/vespa/fnet/config.h @@ -15,8 +15,6 @@ public: uint32_t _maxInputBufferSize; uint32_t _maxOutputBufferSize; bool _tcpNoDelay; - bool _logStats; FNET_Config(); }; - diff --git a/fnet/src/vespa/fnet/connection.cpp b/fnet/src/vespa/fnet/connection.cpp index b9db8a46a4f..d36c8bd87ba 100644 --- a/fnet/src/vespa/fnet/connection.cpp +++ b/fnet/src/vespa/fnet/connection.cpp @@ -233,14 +233,13 @@ FNET_Connection::handshake() EnableReadEvent(true); EnableWriteEvent(writePendingAfterConnect()); size_t chunk_size = std::max(size_t(FNET_READ_SIZE), _socket->min_read_buffer_size()); - uint32_t ignore_stats = 0; ssize_t res = 0; do { // drain input pipeline _input.EnsureFree(chunk_size); res = _socket->drain(_input.GetFree(), _input.GetFreeLen()); if (res > 0) { _input.FreeToData((uint32_t)res); - broken = !handle_packets(ignore_stats); + broken = !handle_packets(); _input.resetIfEmpty(); } } while ((res > 0) && !broken); } @@ -258,7 +257,7 @@ FNET_Connection::handshake() } bool -FNET_Connection::handle_packets(uint32_t &read_packets) +FNET_Connection::handle_packets() { bool broken = false; for (bool done = false; !done;) { // handle each complete packet in the buffer. @@ -268,7 +267,6 @@ FNET_Connection::handle_packets(uint32_t &read_packets) &broken); } if (_flags._gotheader && (_input.GetDataLen() >= _packetLength)) { - read_packets++; HandlePacket(_packetLength, _packetCode, _packetCHID); _flags._gotheader = false; // reset header flag. } else { @@ -282,8 +280,6 @@ bool FNET_Connection::Read() { size_t chunk_size = std::max(size_t(FNET_READ_SIZE), _socket->min_read_buffer_size()); - uint32_t readData = 0; // total data read - uint32_t readPackets = 0; // total packets read int readCnt = 0; // read count bool broken = false; // is this conn broken ? ssize_t res; // single read result @@ -294,8 +290,7 @@ FNET_Connection::Read() while (res > 0) { _input.FreeToData((uint32_t)res); - readData += (uint32_t)res; - broken = !handle_packets(readPackets); + broken = !handle_packets(); _input.resetIfEmpty(); if (broken || (_input.GetFreeLen() > 0) || (readCnt >= FNET_READ_REDO)) { goto done_read; @@ -313,8 +308,7 @@ done_read: readCnt++; if (res > 0) { _input.FreeToData((uint32_t)res); - readData += (uint32_t)res; - broken = !handle_packets(readPackets); + broken = !handle_packets(); _input.resetIfEmpty(); } else if (res == 0) { // fully drained -> EWOULDBLOCK errno = EWOULDBLOCK; @@ -322,16 +316,12 @@ done_read: } } - if (readData > 0) { - UpdateTimeOut(); - CountDataRead(readData); - CountPacketRead(readPackets); - uint32_t maxSize = GetConfig()->_maxInputBufferSize; - if (maxSize > 0 && _input.GetBufSize() > maxSize) - { - if (!_flags._gotheader || _packetLength < maxSize) { - _input.Shrink(maxSize); - } + UpdateTimeOut(); + uint32_t maxSize = GetConfig()->_maxInputBufferSize; + if (maxSize > 0 && _input.GetBufSize() > maxSize) + { + if (!_flags._gotheader || _packetLength < maxSize) { + _input.Shrink(maxSize); } } @@ -354,8 +344,6 @@ bool FNET_Connection::Write() { uint32_t my_write_work = 0; - uint32_t writtenData = 0; // total data written - uint32_t writtenPackets = 0; // total packets written int writeCnt = 0; // write count bool broken = false; // is this conn broken ? ssize_t res; // single write result @@ -374,7 +362,6 @@ FNET_Connection::Write() packet = _myQueue.DequeuePacket_NoLock(&context); if (packet->IsRegularPacket()) { // ignore non-regular packets _streamer->Encode(packet, context._value.INT, &_output); - writtenPackets++; } packet->Free(); } @@ -390,7 +377,6 @@ FNET_Connection::Write() writeCnt++; if (res > 0) { _output.DataToDead((uint32_t)res); - writtenData += (uint32_t)res; _output.resetIfEmpty(); } } while (res > 0 && @@ -409,11 +395,9 @@ FNET_Connection::Write() } } - if (writtenData > 0) { - uint32_t maxSize = GetConfig()->_maxOutputBufferSize; - if (maxSize > 0 && _output.GetBufSize() > maxSize) { - _output.Shrink(maxSize); - } + uint32_t maxSize = GetConfig()->_maxOutputBufferSize; + if (maxSize > 0 && _output.GetBufSize() > maxSize) { + _output.Shrink(maxSize); } if (res < 0) { @@ -438,10 +422,6 @@ FNET_Connection::Write() bool writePending = (_writeWork > 0); guard.unlock(); - if (writtenData > 0) { - CountDataWrite(writtenData); - CountPacketWrite(writtenPackets); - } if (!writePending) EnableWriteEvent(false); diff --git a/fnet/src/vespa/fnet/connection.h b/fnet/src/vespa/fnet/connection.h index 8e5e6280fab..8b0ab74ce5f 100644 --- a/fnet/src/vespa/fnet/connection.h +++ b/fnet/src/vespa/fnet/connection.h @@ -212,9 +212,8 @@ private: * for each one. * * @return false if socket is broken. - * @param read_packets count read packets here **/ - bool handle_packets(uint32_t &read_packets); + bool handle_packets(); /** * Read incoming data from socket. diff --git a/fnet/src/vespa/fnet/fnet.h b/fnet/src/vespa/fnet/fnet.h index 5a3a8b28942..c7570e025ec 100644 --- a/fnet/src/vespa/fnet/fnet.h +++ b/fnet/src/vespa/fnet/fnet.h @@ -32,8 +32,6 @@ class FNET_Packet; class FNET_PacketQueue; class FNET_Scheduler; class FNET_SimplePacketStreamer; -class FNET_StatCounters; -class FNET_Stats; class FNET_Task; class FNET_Transport; class FNET_TransportThread; @@ -52,7 +50,6 @@ class FNET_TransportThread; #include "task.h" #include "scheduler.h" #include "config.h" -#include "stats.h" #include "databuffer.h" #include "packet.h" #include "dummypacket.h" diff --git a/fnet/src/vespa/fnet/iocomponent.cpp b/fnet/src/vespa/fnet/iocomponent.cpp index 148dabf5c60..d4244cbf204 100644 --- a/fnet/src/vespa/fnet/iocomponent.cpp +++ b/fnet/src/vespa/fnet/iocomponent.cpp @@ -12,7 +12,6 @@ FNET_IOComponent::FNET_IOComponent(FNET_TransportThread *owner, : _ioc_next(nullptr), _ioc_prev(nullptr), _ioc_owner(owner), - _ioc_counters(_ioc_owner->GetStatCounters()), _ioc_socket_fd(socket_fd), _ioc_selector(nullptr), _ioc_spec(nullptr), diff --git a/fnet/src/vespa/fnet/iocomponent.h b/fnet/src/vespa/fnet/iocomponent.h index 16ecce2e345..901c3d1a5d0 100644 --- a/fnet/src/vespa/fnet/iocomponent.h +++ b/fnet/src/vespa/fnet/iocomponent.h @@ -2,14 +2,12 @@ #pragma once -#include "stats.h" #include <vespa/fastos/timestamp.h> #include <vespa/vespalib/net/selector.h> #include <mutex> #include <condition_variable> class FNET_TransportThread; -class FNET_StatCounters; class FNET_Config; /** @@ -45,7 +43,6 @@ protected: FNET_IOComponent *_ioc_next; // next in list FNET_IOComponent *_ioc_prev; // prev in list FNET_TransportThread *_ioc_owner; // owner(TransportThread) ref. - FNET_StatCounters *_ioc_counters; // stat counters int _ioc_socket_fd; // source of events. Selector *_ioc_selector; // attached event selector char *_ioc_spec; // connect/listen spec @@ -154,47 +151,6 @@ public: **/ void UpdateTimeOut(); - - /** - * Count packet read(s). This is a proxy method updating the stat - * counters associated with the owning transport object. - * - * @param cnt the number of packets read (default is 1). - **/ - void CountPacketRead(uint32_t cnt = 1) - { _ioc_counters->CountPacketRead(cnt); } - - - /** - * Count packet write(s). This is a proxy method updating the stat - * counters associated with the owning transport object. - * - * @param cnt the number of packets written (default is 1). - **/ - void CountPacketWrite(uint32_t cnt = 1) - { _ioc_counters->CountPacketWrite(cnt); } - - - /** - * Count read data. This is a proxy method updating the stat - * counters associated with the owning transport object. - * - * @param bytes the number of bytes read. - **/ - void CountDataRead(uint32_t bytes) - { _ioc_counters->CountDataRead(bytes); } - - - /** - * Count written data. This is a proxy method updating the stat - * counters associated with the owning transport object. - * - * @param bytes the number of bytes written. - **/ - void CountDataWrite(uint32_t bytes) - { _ioc_counters->CountDataWrite(bytes); } - - /** * Attach an event selector to this component. Before deleting an * IOC, one must first call detach_selector to detach the diff --git a/fnet/src/vespa/fnet/stats.cpp b/fnet/src/vespa/fnet/stats.cpp deleted file mode 100644 index f156fe4afe7..00000000000 --- a/fnet/src/vespa/fnet/stats.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "stats.h" - -#include <vespa/log/log.h> -LOG_SETUP(".fnet"); - -FNET_StatCounters::FNET_StatCounters() - : _eventLoopCnt(0), - _eventCnt(0), - _ioEventCnt(0), - _packetReadCnt(0), - _packetWriteCnt(0), - _dataReadCnt(0), - _dataWriteCnt(0) -{ -} - - -FNET_StatCounters::~FNET_StatCounters() -{ -} - - -void -FNET_StatCounters::Clear() -{ - _eventLoopCnt = 0; - _eventCnt = 0; - _ioEventCnt = 0; - _packetReadCnt = 0; - _packetWriteCnt = 0; - _dataReadCnt = 0; - _dataWriteCnt = 0; -} - -//----------------------------------------------- - -FNET_Stats::FNET_Stats() - : _eventLoopRate(0), - _eventRate(0), - _ioEventRate(0), - _packetReadRate(0), - _packetWriteRate(0), - _dataReadRate(0), - _dataWriteRate(0) -{ -} - - -FNET_Stats::~FNET_Stats() -{ -} - - -void -FNET_Stats::Update(FNET_StatCounters *count, double secs) -{ - _eventLoopRate = (float)(FNET_STATS_OLD_FACTOR * _eventLoopRate - + (FNET_STATS_NEW_FACTOR - * ((double)count->_eventLoopCnt / secs))); - _eventRate = (float)(FNET_STATS_OLD_FACTOR * _eventRate - + (FNET_STATS_NEW_FACTOR - * ((double)count->_eventCnt / secs))); - _ioEventRate = (float)(FNET_STATS_OLD_FACTOR * _ioEventRate - + (FNET_STATS_NEW_FACTOR - * ((double)count->_ioEventCnt / secs))); - - _packetReadRate = (float)(FNET_STATS_OLD_FACTOR * _packetReadRate - + (FNET_STATS_NEW_FACTOR - * ((double)count->_packetReadCnt / secs))); - _packetWriteRate = (float)(FNET_STATS_OLD_FACTOR * _packetWriteRate - + (FNET_STATS_NEW_FACTOR - * ((double)count->_packetWriteCnt / secs))); - - _dataReadRate = (float)(FNET_STATS_OLD_FACTOR * _dataReadRate - + (FNET_STATS_NEW_FACTOR - * ((double)count->_dataReadCnt / (1000.0 * secs)))); - _dataWriteRate = (float)(FNET_STATS_OLD_FACTOR * _dataWriteRate - + (FNET_STATS_NEW_FACTOR - * ((double)count->_dataWriteCnt / (1000.0 * secs)))); -} - - -void -FNET_Stats::Log() -{ - LOG(info, "events[/s][loop/int/io][%.1f/%.1f/%.1f] " - "packets[/s][r/w][%.1f/%.1f] " - "data[kB/s][r/w][%.2f/%.2f]", - _eventLoopRate, - _eventRate, - _ioEventRate, - _packetReadRate, - _packetWriteRate, - _dataReadRate, - _dataWriteRate); -} diff --git a/fnet/src/vespa/fnet/stats.h b/fnet/src/vespa/fnet/stats.h deleted file mode 100644 index 76651393165..00000000000 --- a/fnet/src/vespa/fnet/stats.h +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#pragma once - -#include <cstdint> - -/** - * This class is used internally by @ref FNET_Transport objects to - * aggregate FNET statistics. The actual statistics are located in the - * @ref FNET_Stats class. - **/ -class FNET_StatCounters -{ -public: - uint32_t _eventLoopCnt; // # event loop iterations - uint32_t _eventCnt; // # internal events - uint32_t _ioEventCnt; // # IO events - uint32_t _packetReadCnt; // # packets read - uint32_t _packetWriteCnt; // # packets written - uint32_t _dataReadCnt; // # bytes read - uint32_t _dataWriteCnt; // # bytes written - - FNET_StatCounters(); - ~FNET_StatCounters(); - - void Clear(); - void CountEventLoop(uint32_t cnt) { _eventLoopCnt += cnt; } - void CountEvent(uint32_t cnt) { _eventCnt += cnt; } - void CountIOEvent(uint32_t cnt) { _ioEventCnt += cnt; } - void CountPacketRead(uint32_t cnt) { _packetReadCnt += cnt; } - void CountPacketWrite(uint32_t cnt) { _packetWriteCnt += cnt; } - void CountDataRead(uint32_t bytes) { _dataReadCnt += bytes; } - void CountDataWrite(uint32_t bytes) { _dataWriteCnt += bytes; } -}; - -//----------------------------------------------- - -#define FNET_STATS_OLD_FACTOR 0.5 -#define FNET_STATS_NEW_FACTOR 0.5 - -/** - * This class contains various FNET statistics. The statistics for a - * @ref FNET_Transport object may be obtained by invoking the GetStats - * method on it. - **/ -class FNET_Stats -{ -public: - /** - * Event loop iterations per second. - **/ - float _eventLoopRate; // loop iterations/s - - /** - * Internal events handled per second. - **/ - float _eventRate; // internal-events/s - - /** - * IO events handled per second. - **/ - float _ioEventRate; // IO-events/s - - /** - * Packets read per second. - **/ - float _packetReadRate; // packets/s - - /** - * Packets written per second. - **/ - float _packetWriteRate; // packets/s - - /** - * Data read per second (in kB). - **/ - float _dataReadRate; // kB/s - - /** - * Data written per second (in kB). - **/ - float _dataWriteRate; // kB/s - - FNET_Stats(); - ~FNET_Stats(); - - /** - * Update statistics. The new statistics are calculated based on - * both the current values and the input count structure indicating - * what has happened since the last statistics update. - * - * @param count what has happened since last statistics update. - * @param secs number of seconds since last statistics update. - **/ - void Update(FNET_StatCounters *count, double secs); - - /** - * Invoking this method will generate a log message of type - * FNET_INFO showing the values held by this object. - **/ - void Log(); -}; - diff --git a/fnet/src/vespa/fnet/transport.cpp b/fnet/src/vespa/fnet/transport.cpp index 55c847682c4..dfeb8d03436 100644 --- a/fnet/src/vespa/fnet/transport.cpp +++ b/fnet/src/vespa/fnet/transport.cpp @@ -120,14 +120,6 @@ FNET_Transport::SetTCPNoDelay(bool noDelay) } void -FNET_Transport::SetLogStats(bool logStats) -{ - for (const auto &thread: _threads) { - thread->SetLogStats(logStats); - } -} - -void FNET_Transport::sync() { for (const auto &thread: _threads) { diff --git a/fnet/src/vespa/fnet/transport.h b/fnet/src/vespa/fnet/transport.h index dbf914798fd..15e69bd66a6 100644 --- a/fnet/src/vespa/fnet/transport.h +++ b/fnet/src/vespa/fnet/transport.h @@ -195,14 +195,6 @@ public: void SetTCPNoDelay(bool noDelay); /** - * Enable or disable logging of FNET statistics. This feature is - * disabled by default. - * - * @param logStats true if stats should be logged. - **/ - void SetLogStats(bool logStats); - - /** * Synchronize with all transport threads. This method will block * until all events posted before this method was invoked has been * processed. If a transport thread has been shut down (or is in diff --git a/fnet/src/vespa/fnet/transport_thread.cpp b/fnet/src/vespa/fnet/transport_thread.cpp index 34ab9091072..b0388bdc140 100644 --- a/fnet/src/vespa/fnet/transport_thread.cpp +++ b/fnet/src/vespa/fnet/transport_thread.cpp @@ -31,15 +31,6 @@ struct Sync : public FNET_IExecutable } // namespace<unnamed> -#ifndef IAM_DOXYGEN -void -FNET_TransportThread::StatsTask::PerformTask() -{ - _transport->UpdateStats(); - Schedule(5.0); -} -#endif - void FNET_TransportThread::AddComponent(FNET_IOComponent *comp) { @@ -160,22 +151,6 @@ FNET_TransportThread::DiscardEvent(FNET_ControlPacket *cpacket, } -void -FNET_TransportThread::UpdateStats() -{ - _now.SetNow(); // trade some overhead for better stats - double ms = _now.MilliSecs() - _statTime.MilliSecs(); - _statTime = _now; - { - std::lock_guard<std::mutex> guard(_lock); - _stats.Update(&_counters, ms / 1000.0); - } - _counters.Clear(); - - if (_config._logStats) - _stats.Log(); -} - extern "C" { static void pipehandler(int) @@ -203,10 +178,6 @@ FNET_TransportThread::FNET_TransportThread(FNET_Transport &owner_in) _startTime(), _now(), _scheduler(&_now), - _counters(), - _stats(), - _statsTask(&_scheduler, this), - _statTime(), _config(), _componentsHead(nullptr), _timeOutHead(nullptr), @@ -424,8 +395,6 @@ FNET_TransportThread::InitEventLoop() } _now.SetNow(); _startTime = _now; - _statTime = _now; - _statsTask.Schedule(5.0); return true; } @@ -435,7 +404,7 @@ FNET_TransportThread::handle_wakeup() { { std::lock_guard<std::mutex> guard(_lock); - CountEvent(_queue.FlushPackets_NoLock(&_myQueue)); + _queue.FlushPackets_NoLock(&_myQueue); } FNET_Context context; @@ -534,7 +503,6 @@ FNET_TransportThread::EventLoopIteration() // obtain I/O events _selector.poll(msTimeout); - CountEventLoop(); // sample current time (performed once per event loop iteration) _now.SetNow(); @@ -548,7 +516,6 @@ FNET_TransportThread::EventLoopIteration() #endif // handle wakeup and io-events - CountIOEvent(_selector.num_events()); _selector.dispatch(*this); // handle IOC time-outs @@ -579,9 +546,6 @@ FNET_TransportThread::EventLoopIteration() if (_finished) return false; - // unschedule statistics task - _statsTask.Kill(); - // flush event queue { std::lock_guard<std::mutex> guard(_lock); diff --git a/fnet/src/vespa/fnet/transport_thread.h b/fnet/src/vespa/fnet/transport_thread.h index 3e5fe49e73a..1b8d1fa4eeb 100644 --- a/fnet/src/vespa/fnet/transport_thread.h +++ b/fnet/src/vespa/fnet/transport_thread.h @@ -6,7 +6,6 @@ #include "config.h" #include "task.h" #include "packetqueue.h" -#include "stats.h" #include <vespa/fastos/thread.h> #include <vespa/fastos/time.h> #include <vespa/vespalib/net/socket_handle.h> @@ -31,31 +30,11 @@ class FNET_TransportThread : public FastOS_Runnable public: using Selector = vespalib::Selector<FNET_IOComponent>; -#ifndef IAM_DOXYGEN - class StatsTask : public FNET_Task - { - private: - FNET_TransportThread *_transport; - StatsTask(const StatsTask &); - StatsTask &operator=(const StatsTask &); - public: - StatsTask(FNET_Scheduler *scheduler, - FNET_TransportThread *transport) : FNET_Task(scheduler), - _transport(transport) {} - void PerformTask() override; - }; - friend class FNET_TransportThread::StatsTask; -#endif // DOXYGEN - private: FNET_Transport &_owner; // owning transport layer FastOS_Time _startTime; // when event loop started FastOS_Time _now; // current time sampler FNET_Scheduler _scheduler; // transport thread scheduler - FNET_StatCounters _counters; // stat counters - FNET_Stats _stats; // current stats - StatsTask _statsTask; // stats task - FastOS_Time _statTime; // last stat update FNET_Config _config; // FNET configuration [static] FNET_IOComponent *_componentsHead; // I/O component list head FNET_IOComponent *_timeOutHead; // first IOC in list to time out @@ -156,49 +135,6 @@ private: /** - * Update internal FNET statistics. This method is called regularly - * by the statistics update task. - **/ - void UpdateStats(); - - - /** - * Obtain a reference to the stat counters used by this transport - * object. - * - * @return stat counters for this transport object. - **/ - FNET_StatCounters *GetStatCounters() { return &_counters; } - - - /** - * Count event loop iteration(s). - * - * @param cnt event loop iterations (default is 1). - **/ - void CountEventLoop(uint32_t cnt = 1) - { _counters.CountEventLoop(cnt); } - - - /** - * Count internal event(s). - * - * @param cnt number of internal events. - **/ - void CountEvent(uint32_t cnt) - { _counters.CountEvent(cnt); } - - - /** - * Count IO events. - * - * @param cnt number of IO events. - **/ - void CountIOEvent(uint32_t cnt) - { _counters.CountIOEvent(cnt); } - - - /** * Obtain a reference to the object holding the configuration for * this transport object. * @@ -355,15 +291,6 @@ public: /** - * Enable or disable logging of FNET statistics. This feature is - * disabled by default. - * - * @param logStats true if stats should be logged. - **/ - void SetLogStats(bool logStats) { _config._logStats = logStats; } - - - /** * Add an I/O component to the working set of this transport * object. Note that the actual work is performed by the transport * thread. This method simply posts an event on the transport thread |