{
  "type": "module",
  "source": "doc/api/api-clientstats.md",
  "modules": [
    {
      "textRaw": "ClientStats",
      "name": "clientstats",
      "introduced_in": "v7.9.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>A <code>ClientStats</code> is a point-in-time snapshot of the connection and request\nstate of a single <a href=\"Client.html#class-client\"><code>Client</code></a>. Instances are not created directly; a fresh\nsnapshot is produced each time the <a href=\"Client.html#clientstats\"><code>client.stats</code></a> getter is read.</p>\n<pre><code class=\"language-mjs\">import { Client } from 'undici'\n\nconst client = new Client('http://localhost:3000')\nconst stats = client.stats\nconsole.log(stats.connected, stats.running)\n</code></pre>\n<pre><code class=\"language-cjs\">const { Client } = require('undici')\n\nconst client = new Client('http://localhost:3000')\nconst stats = client.stats\nconsole.log(stats.connected, stats.running)\n</code></pre>",
      "classes": [
        {
          "textRaw": "Class: `ClientStats`",
          "name": "ClientStats",
          "type": "class",
          "meta": {
            "added": [
              "v7.9.0"
            ],
            "changes": []
          },
          "desc": "<p>Captures the connection and request counters of a <a href=\"Client.html#class-client\"><code>Client</code></a> at the moment\nthe snapshot is taken. The values are read from the client at construction time\nand do not update afterwards; read <a href=\"Client.html#clientstats\"><code>client.stats</code></a> again for current values.</p>",
          "signatures": [
            {
              "textRaw": "`new ClientStats(client)`",
              "name": "ClientStats",
              "type": "ctor",
              "meta": {
                "added": [
                  "v7.9.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`client` {Client} The client to read the statistics from.",
                  "name": "client",
                  "type": "Client",
                  "desc": "The client to read the statistics from."
                }
              ],
              "desc": "<p>Creates a snapshot from the supplied <code>client</code>. This constructor is used\ninternally by the <a href=\"Client.html#clientstats\"><code>client.stats</code></a> getter and is not normally invoked by\napplication code.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {boolean}",
              "name": "connected",
              "type": "boolean",
              "meta": {
                "added": [
                  "v7.9.0"
                ],
                "changes": []
              },
              "desc": "<p><code>true</code> when the client currently has an open socket connection.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "pending",
              "type": "number",
              "meta": {
                "added": [
                  "v7.9.0"
                ],
                "changes": []
              },
              "desc": "<p>Number of open socket connections of this client that do not have an active\nrequest.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "running",
              "type": "number",
              "meta": {
                "added": [
                  "v7.9.0"
                ],
                "changes": []
              },
              "desc": "<p>Number of currently active requests of this client.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "size",
              "type": "number",
              "meta": {
                "added": [
                  "v7.9.0"
                ],
                "changes": []
              },
              "desc": "<p>Number of active, pending, or queued requests of this client.</p>"
            }
          ]
        }
      ]
    }
  ]
}