1414#include " StatusWebSocketHandler.h"
1515#include " Framework/DeviceMetricsHelper.h"
1616#include " Framework/ServiceMetricsInfo.h"
17+ #include " Framework/Signpost.h"
1718#include < regex>
1819#include " Framework/Logger.h"
1920#include " Framework/DeviceConfigInfo.h"
2021
22+ O2_DECLARE_DYNAMIC_LOG (rate_limiting);
23+
2124namespace o2 ::framework
2225{
2326void ControlWebSocketHandler::frame (char const * frame, size_t s)
@@ -74,6 +77,10 @@ void ControlWebSocketHandler::endChunk()
7477 if (!didProcessMetric) {
7578 return ;
7679 }
80+ O2_SIGNPOST_ID_GENERATE (sid, rate_limiting);
81+ O2_SIGNPOST_START (rate_limiting, sid, " endChunk" ,
82+ " Processing metrics from device %d (had new metric: %d)" ,
83+ mIndex , (int )didHaveNewMetric);
7784 size_t timestamp = (uv_hrtime () - mContext .driver ->startTime ) / 1000000 + mContext .driver ->startTimeMsFromEpoch ;
7885 assert (mContext .metrics );
7986 assert (mContext .infos );
@@ -91,6 +98,8 @@ void ControlWebSocketHandler::endChunk()
9198 for (auto & metricsInfo : *mContext .metrics ) {
9299 std::fill (metricsInfo.changed .begin (), metricsInfo.changed .end (), false );
93100 }
101+ O2_SIGNPOST_END (rate_limiting, sid, " endChunk" ,
102+ " Done processing metrics from device %d" , mIndex );
94103}
95104
96105void ControlWebSocketHandler::headers (std::map<std::string, std::string> const & headers)
0 commit comments