dev.knotless.getUsage

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.

Details · query
Kindquery
Authorityknotless.dev
Indexed
cid bafyreicg5vhxbw6j6gi74q3wiizuberqd3jqe4psfb6sv74oytlcov6z4y

Checks

Valid
JSONDownload
{
  "$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.resource",
            "mcp.signin",
            "git.fetch",
            "cli.version",
            "gateway.delegated",
            "gateway.push",
            "gateway.commit",
            "gateway.served"
          ],
          "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"
    },
    "failure": {
      "description": "Why something the handlers saw failed, and how often.",
      "properties": {
        "error": {
          "description": "What it answered, cut at 300 characters.",
          "type": "string"
        },
        "n": {
          "description": "Times it failed so.",
          "minimum": 0,
          "type": "integer"
        },
        "name": {
          "description": "The event's name, as an event's.",
          "type": "string"
        },
        "subject": {
          "description": "Of what, as an event's.",
          "type": "string"
        }
      },
      "required": [
        "name",
        "subject",
        "error",
        "n"
      ],
      "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": {
            "agents": {
              "description": "Requests by the User-Agent of each crawler or script, most first: the bot client, by name. At most twenty, and at most the last 30 days.",
              "items": {
                "ref": "#count",
                "type": "ref"
              },
              "type": "array"
            },
            "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"
            },
            "failures": {
              "description": "Why what the handlers saw failed, most often first: at most a hundred, and at most the last 30 days.",
              "items": {
                "ref": "#failure",
                "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: the hundred busiest, and every write and every route with a request over two seconds.",
              "items": {
                "ref": "#route",
                "type": "ref"
              },
              "type": "array"
            },
            "statements": {
              "description": "The index's statements that took a tenth of a slow request or more, the most time first: at most fifty, and at most the last 30 days.",
              "items": {
                "ref": "#statement",
                "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"
    },
    "statement": {
      "description": "A statement the index ran slowly, and how often.",
      "properties": {
        "calls": {
          "description": "Times it ran slowly.",
          "minimum": 0,
          "type": "integer"
        },
        "maxMs": {
          "description": "The longest of them, in milliseconds.",
          "minimum": 0,
          "type": "integer"
        },
        "meanMs": {
          "description": "Mean milliseconds of those runs.",
          "minimum": 0,
          "type": "integer"
        },
        "sql": {
          "description": "As written, its whitespace closed up and cut at 500 characters, with no value it was given.",
          "type": "string"
        }
      },
      "required": [
        "sql",
        "calls",
        "meanMs",
        "maxMs"
      ],
      "type": "object"
    }
  },
  "id": "dev.knotless.getUsage",
  "lexicon": 1
}