dev.knotless.getUsage

lexicons.knotless.dev

{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "count": {
      "description": "Something, and how many times.",
      "properties": {
        "n": {
          "minimum": 0,
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "n"
      ],
      "type": "object"
    },
    "day": {
      "description": "One day, in UTC.",
      "properties": {
        "authors": {
          "description": "Accounts that made a repository, pushed, or wrote in a thread.",
          "minimum": 0,
          "type": "integer"
        },
        "checks": {
          "description": "Check runs started.",
          "minimum": 0,
          "type": "integer"
        },
        "comments": {
          "minimum": 0,
          "type": "integer"
        },
        "day": {
          "description": "YYYY-MM-DD.",
          "type": "string"
        },
        "errors": {
          "description": "Of those, failed (5xx).",
          "minimum": 0,
          "type": "integer"
        },
        "issues": {
          "minimum": 0,
          "type": "integer"
        },
        "pulls": {
          "minimum": 0,
          "type": "integer"
        },
        "pushes": {
          "minimum": 0,
          "type": "integer"
        },
        "repos": {
          "description": "Repositories made, from the index.",
          "minimum": 0,
          "type": "integer"
        },
        "requests": {
          "description": "Requests taken, but for health checks.",
          "minimum": 0,
          "type": "integer"
        },
        "views": {
          "description": "Pages they drew.",
          "minimum": 0,
          "type": "integer"
        },
        "visitors": {
          "description": "People whose browsers drew a page, each once.",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "day",
        "visitors",
        "views",
        "requests",
        "errors",
        "repos",
        "pushes",
        "pulls",
        "issues",
        "comments",
        "checks",
        "authors"
      ],
      "type": "object"
    },
    "event": {
      "description": "Something the handlers saw, over the days asked.",
      "properties": {
        "accounts": {
          "description": "Accounts that did anything of this name in the days asked, at most the last 30, as only the signed-in are known and none is kept longer.",
          "minimum": 0,
          "type": "integer"
        },
        "calls": {
          "minimum": 0,
          "type": "integer"
        },
        "failed": {
          "minimum": 0,
          "type": "integer"
        },
        "meanMs": {
          "description": "Mean milliseconds; 0 for what is not timed.",
          "minimum": 0,
          "type": "integer"
        },
        "name": {
          "description": "What it was.",
          "knownValues": [
            "mcp.tool",
            "mcp.signin",
            "git.fetch",
            "cli.version",
            "gateway.delegated",
            "gateway.push",
            "gateway.commit"
          ],
          "type": "string"
        },
        "subject": {
          "description": "Of what: the tool, the repository as asked for, the version; empty for none.",
          "type": "string"
        }
      },
      "required": [
        "name",
        "subject",
        "calls",
        "failed",
        "meanMs",
        "accounts"
      ],
      "type": "object"
    },
    "funnel": {
      "description": "Accounts that did one thing in the days asked, not having in the 30 days before, and of them those that did the other then or within 30 days.",
      "properties": {
        "from": {
          "description": "An event's name.",
          "type": "string"
        },
        "reached": {
          "minimum": 0,
          "type": "integer"
        },
        "started": {
          "minimum": 0,
          "type": "integer"
        },
        "to": {
          "description": "An event's name.",
          "type": "string"
        }
      },
      "required": [
        "from",
        "to",
        "started",
        "reached"
      ],
      "type": "object"
    },
    "hour": {
      "properties": {
        "errors": {
          "description": "Of those, the ones it failed (5xx).",
          "minimum": 0,
          "type": "integer"
        },
        "hour": {
          "description": "The hour, as YYYY-MM-DDTHH in UTC.",
          "type": "string"
        },
        "overTwo": {
          "description": "Of those, the ones that took over two seconds.",
          "minimum": 0,
          "type": "integer"
        },
        "requests": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "hour",
        "requests",
        "errors",
        "overTwo"
      ],
      "type": "object"
    },
    "main": {
      "description": "How an appview is used, day by day, for its operators: it takes a service token for this method from one of the accounts it names as its operators, or the session cookie of one logged in to its pages. What it counted itself (requests, page views, visitors by a hash forgotten each day, what its handlers saw) beside what its index says the network wrote.",
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "clients": {
              "description": "Requests by kind of client: browser, git, cli, bot or other.",
              "items": {
                "ref": "#count",
                "type": "ref"
              },
              "type": "array"
            },
            "days": {
              "description": "Each day asked about, oldest first.",
              "items": {
                "ref": "#day",
                "type": "ref"
              },
              "type": "array"
            },
            "events": {
              "description": "What the handlers saw, by name and subject.",
              "items": {
                "ref": "#event",
                "type": "ref"
              },
              "type": "array"
            },
            "funnels": {
              "description": "Of the accounts that did one thing in the days asked, not having in the 30 days before, how many went on to another.",
              "items": {
                "ref": "#funnel",
                "type": "ref"
              },
              "type": "array"
            },
            "hours": {
              "description": "Each hour the appview took requests in, oldest first: when failures and slow answers came.",
              "items": {
                "ref": "#hour",
                "type": "ref"
              },
              "type": "array"
            },
            "network": {
              "ref": "#network",
              "type": "ref"
            },
            "pages": {
              "description": "Pages drawn in a browser, by the route that drew them.",
              "items": {
                "ref": "#count",
                "type": "ref"
              },
              "type": "array"
            },
            "referrers": {
              "description": "The sites that sent visitors to the pages, by host.",
              "items": {
                "ref": "#count",
                "type": "ref"
              },
              "type": "array"
            },
            "routes": {
              "description": "Requests by route, busiest first.",
              "items": {
                "ref": "#route",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "days",
            "routes",
            "pages",
            "referrers",
            "clients"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "days": {
            "default": 14,
            "description": "How many days back, today (UTC) the last.",
            "maximum": 400,
            "minimum": 1,
            "type": "integer"
          }
        },
        "type": "params"
      },
      "type": "query"
    },
    "network": {
      "description": "The network as the index has it now.",
      "properties": {
        "accounts": {
          "description": "Accounts that ever made a repository, pushed, or wrote in a thread.",
          "minimum": 0,
          "type": "integer"
        },
        "authorsMonth": {
          "description": "And in the last 30.",
          "minimum": 0,
          "type": "integer"
        },
        "authorsWeek": {
          "description": "Accounts that did so in the last 7 days.",
          "minimum": 0,
          "type": "integer"
        },
        "repos": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "accounts",
        "repos",
        "authorsWeek",
        "authorsMonth"
      ],
      "type": "object"
    },
    "route": {
      "description": "A route, by the pattern it matched, and how it answered.",
      "properties": {
        "errors": {
          "description": "Failed (5xx).",
          "minimum": 0,
          "type": "integer"
        },
        "meanMs": {
          "description": "Mean milliseconds to the answer's head.",
          "minimum": 0,
          "type": "integer"
        },
        "method": {
          "description": "The HTTP method.",
          "type": "string"
        },
        "overHalf": {
          "description": "Requests that took over half a second.",
          "minimum": 0,
          "type": "integer"
        },
        "overTwo": {
          "description": "Requests that took over two seconds.",
          "minimum": 0,
          "type": "integer"
        },
        "requests": {
          "minimum": 0,
          "type": "integer"
        },
        "route": {
          "description": "Its pattern, as /api/{authority}/{repo}/tree.",
          "type": "string"
        },
        "surface": {
          "description": "Where it is.",
          "knownValues": [
            "pages",
            "api",
            "git",
            "xrpc",
            "mcp",
            "install",
            "other"
          ],
          "type": "string"
        }
      },
      "required": [
        "surface",
        "method",
        "route",
        "requests",
        "errors",
        "meanMs",
        "overHalf",
        "overTwo"
      ],
      "type": "object"
    }
  },
  "id": "dev.knotless.getUsage",
  "lexicon": 1
}

Validate Record

Validate a record against dev.knotless.getUsage

Validation Options
Treat any remaining unresolved references as valid

Metadata

DID
did:plc:yqsg7znbbhfmj3a2nrpnaerk
CID
bafyreibjtqusvd7affytxduhy7x5jf2ss6425yfzdrejmiazkx7j6j237i
Indexed At
2026-10-28 21:21 UTC
AT-URI
at://did:plc:yqsg7znbbhfmj3a2nrpnaerk/com.atproto.lexicon.schema/dev.knotless.getUsage

Similar Lexicons

Lexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.

  • What an appview shows anyone of how it is used: the network as its index has it now, and each of the last 30 days, what the network wrote in it and how many people drew its pages (by a hash forgotten each day). Its oper…

Lexicon Garden

@