openresty / openresty/set-misc-nginx-module

Feature request: high resolution timestamp variable

Open
#6 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
401
Forks
100
Avg merge
1h 28m
Merged PRs (30d)
2

Description

Hello,

I'd like to put a timestamp into my upstream request URIs (or include it as a request header with the HeardsMore module), so it'd be great if you could implement a few other special variables:

  • tsc_time using a crude but fast solution[0] of reading the TSC register and dividing it with the MHZ from /proc/cpuinfo ~ 50 cycles
  • gettimeofday: ngx_gettimeofday is just a macro for gettimeofday( tp, NULL) ~ 10K cycles
  • clock_gettime(CLOCK_MONOTONIC , ...) or with other CLOCK_* ~ 10K cycles

Thanks!

[0] http://stackoverflow.com/questions/88/is-gettimeofday-guaranteed-to-be-of-microsecond-resolution/367#367

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The payload names no file, test, or entry point. Start by locating the module's special-variable handling and the code that builds upstream request URIs or headers; determine which timestamp sources and output semantics are supported, with coverage for each requested variable.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, nginx
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.