Browse Source

Document server statistics API - Step 22/22 (or 99/99) of #243

bel2125 8 năm trước cách đây
mục cha
commit
074a34d32a

+ 7 - 0
docs/APIReference.md

@@ -101,6 +101,13 @@ the API can be found in [Embedding.md](Embedding.md).
 * [`mg_write( conn, buf, len );`](api/mg_write.md)
 
 
+## Diagnosis Functions
+
+* [`mg_get_system_info( buffer, buf_len );`](api/mg_get_system_info.md)
+* [`mg_get_context_info( ctx, buffer, buf_len );`](api/mg_get_context_info.md)
+* [`mg_get_connection_info( ctx, idx, buffer, buf_len );`](api/mg_get_context_info.md)
+
+
 ## Deprecated:
 
 * [~~`mg_get_valid_option_names();`~~](api/mg_get_valid_option_names.md)

+ 5 - 1
docs/api/mg_get_connection_info.md

@@ -19,7 +19,11 @@
 
 ### Description
 
-The function `mg_get_connection_info()` returns statistics information collected for a possible server connection. This may be empty if the server has not been built with statistics support (`#define USE_SERVER_STATS`). Otherwise the returned string is in JSON format.
+The function `mg_get_connection_info()` returns statistics information collected for 
+a server connection index.  This may be empty if the server has not been built with 
+statistics support (`#define USE_SERVER_STATS`). 
+If data is available, the returned string is in JSON format. The exact content may
+vary, depending on the connection state and server version.
 
 ### Note
 

+ 5 - 1
docs/api/mg_get_context_info.md

@@ -18,7 +18,11 @@
 
 ### Description
 
-The function `mg_get_context_info()` returns statistics information collected for the server context. This may be empty if the server has not been built with statistics support (`#define USE_SERVER_STATS`). Otherwise the returned string is in JSON format.
+The function `mg_get_context_info()` returns statistics information collected for
+the server context.  This may be empty if the server has not been built with
+statistics support (`#define USE_SERVER_STATS`).
+If data is available, the returned string is in JSON format. The exact content may
+vary, depending on the server state and server version.
 
 ### See Also
 

+ 6 - 1
docs/api/mg_get_system_info.md

@@ -17,7 +17,12 @@
 
 ### Description
 
-The function `mg_get_system_info()` returns information collected for the system (operating system, compiler, version, ...). The string is in a human readable format - changes in the format are possible in future versions. This string should be included for support requests.
+The function `mg_get_system_info()` returns information collected for the system 
+(operating system, compiler, version, ...). 
+Currently this data is returned as string is in JSON format, but changes to the 
+format are possible in future versions.  The exact content of the JSON object may vary, 
+depending on the operating system and server version.
+This string should be included for support requests.
 
 ### See Also
 

+ 4 - 1
include/civetweb.h

@@ -1218,6 +1218,7 @@ CIVETWEB_API unsigned mg_check_feature(unsigned feature);
    Return:
      Available size of system information, exluding a terminating 0.
      The information is complete, if the return value is smaller than buflen.
+     The result is a JSON formatted string, the exact content may vary.
    Note:
      It is possible to determine the required buflen, by first calling this
      function with buffer = NULL and buflen = NULL. The required buflen is
@@ -1234,7 +1235,8 @@ CIVETWEB_API int mg_get_system_info(char *buffer, int buflen);
    Return:
      Available size of system information, exluding a terminating 0.
      The information is complete, if the return value is smaller than buflen.
-   Note:
+     The result is a JSON formatted string, the exact content may vary.
+     Note:
      It is possible to determine the required buflen, by first calling this
      function with buffer = NULL and buflen = NULL. The required buflen is
      one byte more than the returned value. However, since the available
@@ -1254,6 +1256,7 @@ mg_get_context_info(const struct mg_context *ctx, char *buffer, int buflen);
    Return:
      Available size of system information, exluding a terminating 0.
      The information is complete, if the return value is smaller than buflen.
+     The result is a JSON formatted string, the exact content may vary.
    Note:
      It is possible to determine the required buflen, by first calling this
      function with buffer = NULL and buflen = NULL. The required buflen is