---
name: "memcached_analyze"
section: "3"
platform: "linux"
package: "libmemcached-awesome"
version: "1.1.4-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/memcached_analyze"
---

# memcached\_analyze(3)

libmemcached Documentation

## NAME

memcached\_analyze - libmemcached Documentation

## SYNOPSIS

- **#include \<libmemcached/memcached.h\>**

  Compile and link with -lmemcached

- **typedef struct memcached\_analysis\_st memcached\_analysis\_st**

  - **memcached\_analysis\_st \*memcached\_analyze(memcached\_st \<#\_CPPv412memcached\_st\> \*ptr, memcached\_stat\_st \<#\_CPPv417memcached\_stat\_st\> \*stat, memcached\_return\_t \<#\_CPPv418memcached\_return\_t\> \*error)**

  - **Parameters**

    - •

      **ptr** -- pointer to initialized **memcached\_st** \<#\_CPPv412memcached\_st\> struct

    - •

      **stat** -- pointer to a **memcached\_stat\_st** \<#\_CPPv417memcached\_stat\_st\> struct to fill

    - •

      **error** -- pointer to **memcached\_return\_t** \<#\_CPPv418memcached\_return\_t\> indicating success

  - **Returns**

    pointer to an allocated and filled out **memcached\_analysis\_t** struct

## DESCRIPTION

**libmemcached** has the ability to query a memcached server (or collection of servers) for their current state. Queries to find state return a **memcached\_analysis\_st** structure. You are responsible for freeing this structure.

**memcached\_analyze()** analyzes useful information based on the provided servers and sets the result to the **memcached\_analysis\_st** structure. The return value must be freed by the calling application.

**See also:**

**memstat -a\|--analyze \[\<arg\>\]** A command line tool to analyze a memcached server.

## RETURN VALUE

A pointer to the allocated **memcached\_analysis\_st** structure on success and a NULL pointer on failure. You may inspect the error detail by checking the **memcached\_return\_t** \<#\_CPPv418memcached\_return\_t\> value.

Any method returning a **memcached\_analysis\_st** expects you to free the memory allocated for it.

## SEE ALSO

**[memcached(1)](/memcached/1.md) \<https://linux.die.net/man/1/memcached\>** **[libmemcached(3)](/libmemcached/3.md) \<https://linux.die.net/man/3/libmemcached\>** **[memcached\_strerror(3)](/memcached_strerror/3.md) \<https://linux.die.net/man/3/memcached\_strerror\>**
