Skip to content

Commit 59e4db8

Browse files
committed
Add documentation for server statistics string.
1 parent 2c3c41f commit 59e4db8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/falcon/server.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ def call(...)
6868
@active_count -= 1
6969
end
7070

71+
# Generates a human-readable string representing the current statistics.
72+
#
73+
# e.g. `C=23/3.42K R=2/3.42K L=0.273`
74+
#
75+
# This can be interpreted as:
76+
#
77+
# - `C=23/3.42K` - The number of connections currently open and the total number of connections accepted.
78+
# - `R=2/3.42K` - The number of requests currently being processed and the total number of requests received.
79+
# - `L=0.273` - The average scheduler load of the server, where 0.0 is idle and 1.0 is fully loaded.
80+
#
81+
# @returns [String] A string representing the current statistics.
7182
def statistics_string
7283
"C=#{format_count @connection_count}/#{format_count @accept_count} R=#{format_count @active_count}/#{format_count @request_count}"
7384
end

0 commit comments

Comments
 (0)