Skip to content

Commit

Permalink
Introduce Endpoint#seconds_{reading,processing}_messages for the API
Browse files Browse the repository at this point in the history
  • Loading branch information
Al2Klimov committed Dec 10, 2024
1 parent ecea525 commit 3ebbfc6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/base/benchmark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Benchmark
* @return The total accumulated time in seconds
*/
template<class T>
explicit operator T() const noexcept
operator T() const noexcept
{
return std::chrono::duration<T>(Clock::duration(m_Sum.load(std::memory_order_relaxed))).count();
}
Expand Down
10 changes: 10 additions & 0 deletions lib/remote/endpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,13 @@ double Endpoint::GetBytesReceivedPerSecond() const
{
return m_BytesReceived.CalculateRate(Utility::GetTime(), 60);
}

double Endpoint::GetSecondsReadingMessages() const
{
return m_InputReadTime;
}

double Endpoint::GetSecondsProcessingMessages() const
{
return m_InputProcessTime;
}
3 changes: 3 additions & 0 deletions lib/remote/endpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class Endpoint final : public ObjectImpl<Endpoint>
double GetBytesSentPerSecond() const override;
double GetBytesReceivedPerSecond() const override;

double GetSecondsReadingMessages() const override;
double GetSecondsProcessingMessages() const override;

protected:
void OnAllConfigLoaded() override;

Expand Down
8 changes: 8 additions & 0 deletions lib/remote/endpoint.ti
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ class Endpoint : ConfigObject
[no_user_modify, no_storage] double bytes_received_per_second {
get;
};

[no_user_modify, no_storage] double seconds_reading_messages {
get;
};

[no_user_modify, no_storage] double seconds_processing_messages {
get;
};
};

}

0 comments on commit 3ebbfc6

Please sign in to comment.