{"id":13420632,"url":"https://github.com/jib/libvmod-timers","last_synced_at":"2025-10-30T16:26:16.116Z","repository":{"id":4393776,"uuid":"5530832","full_name":"jib/libvmod-timers","owner":"jib","description":"Access to various timers in Varnish","archived":false,"fork":false,"pushed_at":"2015-03-30T23:10:31.000Z","size":155,"stargazers_count":20,"open_issues_count":2,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-20T04:11:15.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jib.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-23T18:51:56.000Z","updated_at":"2021-05-03T09:32:50.000Z","dependencies_parsed_at":"2022-08-28T09:21:46.888Z","dependency_job_id":null,"html_url":"https://github.com/jib/libvmod-timers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jib%2Flibvmod-timers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jib%2Flibvmod-timers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jib%2Flibvmod-timers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jib%2Flibvmod-timers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jib","download_url":"https://codeload.github.com/jib/libvmod-timers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243701016,"owners_count":20333614,"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-07-30T22:01:37.867Z","updated_at":"2025-10-30T16:26:11.069Z","avatar_url":"https://github.com/jib.png","language":"C","funding_links":[],"categories":["TODO scan for Android support in followings"],"sub_categories":[],"readme":"============\nvmod_timers\n============\n\n----------------------\nVarnish timers Module\n----------------------\n\n:Author: Jos Boumans\n:Date: 2012-08-22\n:Version: 1.0\n:Manual section: 3\n\nSYNOPSIS\n========\n\n                import timers;\n\n                sub vcl_init {\n                    # Optional, defaults to milliseconds\n                    timers.unit( \"microseconds\" );\n                }\n\n                sub vcl_deliver {\n                    ### In seconds since the epoch, with 3 decimal points\n                    set resp.http.x-req_start       = timers.req_start();\n                    set resp.http.x-req_end         = timers.req_end();\n\n                    ### As a timestamp. like \"Fri, 24 Aug 2012 19:48:03 GMT\"\n                    set resp.http.x-req_start_ts    = timers.req_start_as_string();\n                    set resp.http.x-req_end_ts      = timers.req_end_as_string();\n\n                    ### Durations as an int, in your choice of units (see timers.unit)\n                    ### Time from connection accept to delegation to backend\n                    set resp.http.x-req_handle_time     = timers.req_handle_time();\n\n                    ### Time from delegation to backend to first byte from backend\n                    set resp.http.x-req_response_time   = timers.req_response_time();\n                }\n\n\nDESCRIPTION\n===========\n\nVarnish Module (vmod) for accessing various timers from Varnish.\n\nThe duration counters are compatible with usage in vmod_statsd (see below).\n\n\nFUNCTIONS\n=========\n\nunit\n----\n\nPrototype::\n\n                unit(STRING S)\n\nReturn value\n\tNONE\nDescription\n    Set the base unit of durations. Your choices are: \"seconds\", \"milliseconds\",\n    \"microseconds\" and \"nanoseconds\". Best used in vcl_init. Defaults to \"milliseconds\"\n\nExample::\n\n                timers.unit( \"nanoseconds\" );\n\nreq_start\n---------\n\nPrototype::\n\n                req_start();\n\nReturn value\n\tREAL\n\nDescription\n    Returns the start time of the request, in seconds since the epoch, as a number with 3\n    decimal places.\tCan be used in vcl_recv and onwards.\n\nExample::\n\n                # Will set the header to something like: 1345837683.704\n                set resp.http.x-req_start = timers.req_start();\n\nreq_end\n-------\n\nPrototype::\n\n                req_end();\n\nReturn value\n\tREAL\nDescription\n    Returns the end time of the request, in seconds since the epoch, as a number with 3\n    decimal places.\tCan be used in vcl_deliver and onwards.\n\nExample::\n\n                # Will set the header to something like: 1345837683.704\n                set resp.http.x-req_end = timers.req_end();\n\nreq_start_as_string\n-------------------\n\nPrototype::\n\n                req_start_as_string()\n\nReturn value\n\tSTRING\nDescription\n\tReturns the start time of the request, formatted as an HTTP compatible timestamp.\n\tCan be used in vcl_recv and onwards.\n\nExample::\n\n                # Will set the header to something like: Fri, 24 Aug 2012 19:48:03 GMT\n                set resp.http.x-req_start_ts = timers.req_start_as_string();\n\nreq_end_as_string\n-----------------\n\nPrototype::\n\n                req_end_as_string()\n\nReturn value\n\tSTRING\nDescription\n\tReturns the end time of the request, formatted as an HTTP compatible timestamp.\n\tCan be used in vcl_deliver and onwards.\n\nExample::\n\n                # Will set the header to something like: Fri, 24 Aug 2012 19:48:03 GMT\n                set resp.http.x-req_end_ts = timers.req_end_as_string();\n\nreq_handle_time\n---------------\n\nPrototype::\n\n                req_handle_time()\n\nReturn value\n\tINT\nDescription\n\tReturn the time it took from the client connection being accepted to the request\n\tbeing handed off to a backend. Note that multiple requests can come in over the\n\tsame connection, and that the start marker for this is the accepted connection;\n\tother requests may have been handled during this time!\n\tThe unit for this value is determinted by timers.unit and defaults to milliseconds.\n\tCan be used in vcl_recv and onwards.\n\n\tThis duration is compatible with usage in vmod_statsd (see below)\n\nExample::\n\n                # Will set the header to something like: 119\n                set resp.http.x-req_handle_time = timers.req_handle_time();\n\nreq_response_time\n-----------------\n\nPrototype::\n\n                req_response_time()\n\nReturn value\n\tINT\nDescription\n\tReturn the time it took from when the request was handed off to a backend until the\n\tfirst byte was returned from that backend. This is the effectively the server response\n\ttime.\n\tThe unit for this value is determinted by timers.unit and defaults to milliseconds.\n\tCan be used in vcl_deliver and onwards.\n\n\tThis duration is compatible with usage in vmod_statsd (see below)\n\nExample::\n\n                # Will set the header to something like: 119\n                set resp.http.x-req_response_time = timers.req_response_time();\n\n\n\nINSTALLATION\n============\n\nIf you received this packge without a pre-generated configure script, you must\nhave the GNU Autotools installed, and can then run the 'autogen.sh' script. If\nyou received this package with a configure script, skip to the second\ncommand-line under Usage to configure.\n\nUsage::\n\n # Generate configure script\n ./autogen.sh\n\n # Execute configure script\n ./configure VARNISHSRC=DIR [VMODDIR=DIR]\n\n`VARNISHSRC` is the directory of the Varnish source tree for which to\ncompile your vmod. Both the `VARNISHSRC` and `VARNISHSRC/include`\nwill be added to the include search paths for your module.\n\nOptionally you can also set the vmod install directory by adding\n`VMODDIR=DIR` (defaults to the pkg-config discovered directory from your\nVarnish installation).\n\nMake targets:\n\n* make - builds the vmod\n* make install - installs your vmod in `VMODDIR`\n* make check - runs the unit tests in ``src/tests/*.vtc``\n\n\nSEE ALSO\n========\n\n* https://github.com/jib/libvmod-statsd\n* https://www.varnish-cache.org\n* http://jiboumans.wordpress.com/2013/02/27/realtime-stats-from-varnish/\n* https://gist.github.com/jib/5034755\n\nCOPYRIGHT\n=========\n\nThis document is licensed under the same license as the\nlibvmod-timers project. See LICENSE for details.\n\n* Copyright (c) 2012 Jos Boumans\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjib%2Flibvmod-timers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjib%2Flibvmod-timers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjib%2Flibvmod-timers/lists"}