.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "MEMCACHED_STAT_GET_VALUE" "3" "Feb 01, 2024" "1.1" "libmemcached-awesome" .SH NAME memcached_stat_get_value \- libmemcached Documentation .sp Get memcached statistics .SH SYNOPSIS .INDENT 0.0 .TP .B #include Compile and link with \-lmemcached .UNINDENT .INDENT 0.0 .TP .B typedef struct \fI\%memcached_stat_st\fP memcached_stat_st .UNINDENT .INDENT 0.0 .TP .B typedef \fI\%memcached_return_t\fP (*memcached_stat_fn)(const memcached_instance_st *server, const char *key, size_t key_length, const char *value, size_t value_length, void *context) .INDENT 7.0 .TP .B Param server pointer to the \fBmemcached_instance_st\fP being stat\(aqed .TP .B Param key the current key .TP .B Param key_length the length of the \fBkey\fP without any terminating zero .TP .B Param value the value read .TP .B Param value_length the length of the value without any terminating zero .TP .B Param context pointer to the user supplied context .TP .B Returns \fI\%memcached_return_t\fP indicating success .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_stat_st\fP *memcached_stat(\fI\%memcached_st\fP *ptr, char *args, \fI\%memcached_return_t\fP *error) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBptr\fP \-\- pointer to an initialized \fI\%memcached_st\fP struct .IP \(bu 2 \fBargs\fP \-\- particular state object to query .IP \(bu 2 \fBerror\fP \-\- pointer to \fI\%memcached_return_t\fP indicating success .UNINDENT .TP .B Returns array of \fI\%memcached_stat_st\fP objects for all available servers .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_return_t\fP memcached_stat_servername(\fI\%memcached_stat_st\fP *stat, char *args, const char *hostname, in_port_t port) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBstat\fP \-\- pointer to a \fI\%memcached_stat_st\fP struct to fill .IP \(bu 2 \fBargs\fP \-\- particular state object to query .IP \(bu 2 \fBhostname\fP \-\- the hostname or IP address of the server to stat .IP \(bu 2 \fBport\fP \-\- the port of the server to stat .UNINDENT .TP .B Returns \fI\%memcached_return_t\fP indicating success .UNINDENT .UNINDENT .INDENT 0.0 .TP .B char *memcached_stat_get_value(\fI\%memcached_st\fP *ptr, \fI\%memcached_stat_st\fP *stat, const char *key, \fI\%memcached_return_t\fP *error) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBptr\fP \-\- pointer to initialized \fI\%memcached_st\fP struct .IP \(bu 2 \fBstat\fP \-\- pointer to initialized \fI\%memcached_stat_st\fP struct .IP \(bu 2 \fBkey\fP \-\- the statistic to query .IP \(bu 2 \fBerror\fP \-\- pointer to \fI\%memcached_return_t\fP indicating success .UNINDENT .TP .B Returns string value of the statistic .UNINDENT .UNINDENT .INDENT 0.0 .TP .B char **memcached_stat_get_keys(\fI\%memcached_st\fP *ptr, \fI\%memcached_stat_st\fP *stat, \fI\%memcached_return_t\fP *error) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBptr\fP \-\- pointer to initialized \fI\%memcached_st\fP struct .IP \(bu 2 \fBstat\fP \-\- pointer to initialized \fI\%memcached_stat_st\fP struct .IP \(bu 2 \fBerror\fP \-\- pointer to \fI\%memcached_return_t\fP indicating success .UNINDENT .TP .B Returns array of default keys probably available in the statistics .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_return_t\fP memcached_stat_execute(\fI\%memcached_st\fP *ptr, const char *args, \fI\%memcached_stat_fn\fP func, void *context) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBptr\fP \-\- pointer to initialized \fI\%memcached_st\fP struct .IP \(bu 2 \fBargs\fP \-\- particular state object to query .IP \(bu 2 \fBfunc\fP \-\- \fI\%memcached_stat_fn\fP callback .IP \(bu 2 \fBcontext\fP \-\- pointer to user supplied context .UNINDENT .TP .B Returns \fI\%memcached_return_t\fP indication success .UNINDENT .UNINDENT .SH DESCRIPTION .sp \fBlibmemcached\fP has the ability to query a \fBmemcached(1)\fP server (or collection of servers) for their current state. Queries to find state return a \fI\%memcached_stat_st\fP structure. You are responsible for freeing this structure. While it is possible to access the structure directly it is not advisable. \fI\%memcached_stat_get_value()\fP has been provided to query the structure. .sp \fI\%memcached_stat_execute()\fP uses the servers found in \fI\%memcached_stat_st\fP and executes a \(dqstat\(dq command on each server. args is an optional argument that can be passed in to modify the behavior of \(dqstats\(dq. You will need to supply a callback function that will be supplied each pair of values returned by the memcached server. .sp \fI\%memcached_stat()\fP fetches an array of \fI\%memcached_stat_st\fP structures containing the state of all available memcached servers. The return value must be freed by the calling application. If called with the \fI\%MEMCACHED_BEHAVIOR_USE_UDP\fP behavior set, a NULL value is returned and the error parameter is set to \fI\%MEMCACHED_NOT_SUPPORTED\fP\&. .sp \fI\%memcached_stat_servername()\fP can be used standalone without a \fI\%memcached_st\fP to obtain the state of a particular server. \(dqargs\(dq is used to define a particular state object (a list of these are not provided for by either the \fI\%memcached_stat_get_keys()\fP call nor are they defined in the memcached protocol). You must specify the hostname and port of the server you want to obtain information on. .sp \fI\%memcached_stat_get_value()\fP returns the value of a particular state key. You specify the key you wish to obtain. The key must be null terminated. .sp \fI\%memcached_stat_get_keys()\fP returns a list of keys that the server has state objects on. You are responsible for freeing this list. .sp A command line tool, \fBmemstat\fP, is provided so that you do not have to write an application to do this. .SH RETURN VALUE .sp Varies, see particular functions. .sp Any method returning a \fI\%memcached_stat_st\fP expects you to free the memory allocated for it. .SH SEE ALSO .sp \fBmemcached(1)\fP \fBlibmemcached(3)\fP \fBmemcached_strerror(3)\fP .\" Generated by docutils manpage writer. .