~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0
200 lines · 5.0 KB Raw History
{
  "lexicon": 1,
  "id": "org.atgrp.internal.getStats",
  "defs": {
    "main": {
      "type": "query",
      "description": "Get how this host is used, day by day, and what it holds. Nothing in it names who asked anything. Only the accounts the host names as its operators may ask, by service auth.",
      "parameters": {
        "type": "params",
        "properties": {
          "days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 400,
            "default": 7,
            "description": "How many days, today the last (UTC)."
          }
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": [
            "host",
            "days",
            "routes",
            "tools"
          ],
          "properties": {
            "host": {
              "type": "ref",
              "ref": "#held"
            },
            "days": {
              "type": "array",
              "description": "Each day asked for, oldest first, with none left out.",
              "items": {
                "type": "ref",
                "ref": "#day"
              }
            },
            "routes": {
              "type": "array",
              "description": "Each route asked over the days, the most asked first.",
              "items": {
                "type": "ref",
                "ref": "#route"
              }
            },
            "tools": {
              "type": "array",
              "description": "Each MCP tool called over the days, the most called first.",
              "items": {
                "type": "ref",
                "ref": "#tool"
              }
            }
          }
        }
      }
    },
    "held": {
      "type": "object",
      "description": "What the host holds now.",
      "required": [
        "groups",
        "deactivated",
        "spaces",
        "blobBytes"
      ],
      "properties": {
        "groups": {
          "type": "integer",
          "description": "Its groups' accounts, switched off or not."
        },
        "deactivated": {
          "type": "integer",
          "description": "Those switched off."
        },
        "spaces": {
          "type": "integer",
          "description": "The spaces its groups are the authority for."
        },
        "blobBytes": {
          "type": "integer",
          "description": "The bytes of the files its groups' records hold."
        }
      }
    },
    "day": {
      "type": "object",
      "required": [
        "day",
        "requests",
        "refused",
        "failed",
        "slow",
        "toolCalls",
        "groupsMade",
        "spacesMade"
      ],
      "properties": {
        "day": {
          "type": "string",
          "maxLength": 10,
          "description": "The day, as 2026-11-06."
        },
        "requests": {
          "type": "integer",
          "description": "Requests answered, the health checks left out."
        },
        "refused": {
          "type": "integer",
          "description": "Those answered with a 4xx."
        },
        "failed": {
          "type": "integer",
          "description": "Those answered with a 5xx."
        },
        "slow": {
          "type": "integer",
          "description": "Those that took a second or more, streams left out."
        },
        "toolCalls": {
          "type": "integer",
          "description": "MCP tools called."
        },
        "groupsMade": {
          "type": "integer",
          "description": "Groups started, or moved or imported here."
        },
        "spacesMade": {
          "type": "integer",
          "description": "Spaces made."
        }
      }
    },
    "route": {
      "type": "object",
      "required": [
        "route",
        "method",
        "requests",
        "refused",
        "failed",
        "meanMs",
        "slow"
      ],
      "properties": {
        "route": {
          "type": "string",
          "maxLength": 512,
          "description": "The route's pattern, as /xrpc/org.atgrp.internal.getGroup or /img/{did}/{cid}; (unmatched) for a request no route answered."
        },
        "method": {
          "type": "string",
          "maxLength": 16
        },
        "requests": {
          "type": "integer"
        },
        "refused": {
          "type": "integer"
        },
        "failed": {
          "type": "integer"
        },
        "meanMs": {
          "type": "integer",
          "description": "How long one took, on average, in milliseconds."
        },
        "slow": {
          "type": "integer"
        }
      }
    },
    "tool": {
      "type": "object",
      "required": [
        "tool",
        "calls",
        "failed"
      ],
      "properties": {
        "tool": {
          "type": "string",
          "maxLength": 64
        },
        "calls": {
          "type": "integer"
        },
        "failed": {
          "type": "integer",
          "description": "Those that answered with an error."
        }
      }
    }
  }
}