{"id":16182410,"url":"https://github.com/drawveloper/deno-server-timing","last_synced_at":"2025-04-07T12:30:31.700Z","repository":{"id":57675626,"uuid":"459302407","full_name":"drawveloper/deno-server-timing","owner":"drawveloper","description":"Oak middleware to generate server-timing header with tracing functions","archived":false,"fork":false,"pushed_at":"2022-03-15T21:00:30.000Z","size":107,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T15:18:12.461Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drawveloper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-14T19:44:20.000Z","updated_at":"2023-03-09T02:14:33.000Z","dependencies_parsed_at":"2022-09-26T20:41:37.634Z","dependency_job_id":null,"html_url":"https://github.com/drawveloper/deno-server-timing","commit_stats":null,"previous_names":["drawveloper/deno-server-timing"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drawveloper%2Fdeno-server-timing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drawveloper%2Fdeno-server-timing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drawveloper%2Fdeno-server-timing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drawveloper%2Fdeno-server-timing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drawveloper","download_url":"https://codeload.github.com/drawveloper/deno-server-timing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247652464,"owners_count":20973630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T06:31:25.682Z","updated_at":"2025-04-07T12:30:31.674Z","avatar_url":"https://github.com/drawveloper.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deno Server Timing Middleware\n\nImplements `start(label: string)` and `end(label:string)` to trace timings of async operations. Results are concatenated into a [`Server-Timing` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing). \n\n### Getting started\n\n```\nimport { createServerTimingMiddleware } from \"https://deno.land/x/server_timing/mod.ts\"\n\n(...)\n\nconst { start, end, serverTimingMiddleware } = createServerTimingMiddleware()\n\n(... in middleware)\n\nstart('fetch')\nconst dataFromDB = await getData()\nend('fetch')\n\nstart('render')\nconst html = await render(dataFromDB)\nend('render')\n\nresponse.html = html\n```\n\n### Test local example\n\n`denon oak`\n\n`curl 127.0.0.1:8080 --verbose`\n\n\n```\n~ curl 127.0.0.1:8080 --verbose\n*   Trying 127.0.0.1:8080...\n* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)\n\u003e GET / HTTP/1.1\n\u003e Host: 127.0.0.1:8080\n\u003e User-Agent: curl/7.77.0\n\u003e Accept: */*\n\u003e\n* Mark bundle as not supporting multiuse\n\u003c HTTP/1.1 200 OK\n\u003c content-type: text/plain; charset=utf-8\n\u003c server-timing: fetch;dur=702, render;dur=202,\n\u003c content-length: 2\n\u003c date: Mon, 14 Feb 2022 19:37:05 GMT\n\u003c\n* Connection #0 to host 127.0.0.1 left intact\nok%\n```\n\nIn Chrome, you can access Network tab for server timing details on each request:\n\n![Chrome Server Timing Header Screenshot](public/server-timing.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrawveloper%2Fdeno-server-timing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrawveloper%2Fdeno-server-timing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrawveloper%2Fdeno-server-timing/lists"}