Skip to content
Snippets Groups Projects
Verified Commit 9f8b6c5b authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

monotonic timestamps: document they are milliseconds

parent 528e19df
Branches
Tags
1 merge request!418Monotonic nitpicks
Pipeline #28214 passed with stages
in 2 minutes and 55 seconds
......@@ -78,7 +78,7 @@ struct kr_cache
uint32_t ttl_min, ttl_max; /**< Maximum TTL of inserted entries */
struct timeval last_clear_walltime; /**< Time of last cache clear */
uint64_t last_clear_monotime; /**< Last cache clear in monotonic time */
uint64_t last_clear_monotime; /**< Last cache clear in monotonic milliseconds */
};
/**
......
......@@ -84,11 +84,11 @@ struct kr_query {
uint32_t secret;
uint16_t fails;
uint16_t reorder; /**< Seed to reorder (cached) RRs in answer or zero. */
uint64_t creation_time_mono; /* The time of query's creation.
uint64_t creation_time_mono; /* The time of query's creation (milliseconds).
* Or time of creation of an oldest
* ancestor if it is a subquery. */
uint64_t timestamp_mono; /**< Time of query created or time of
query to upstream resolver */
uint64_t timestamp_mono; /**< Time of query created or time of
* query to upstream resolver (milliseconds). */
struct timeval timestamp;
struct kr_zonecut zone_cut;
struct kr_nsrep ns;
......
......@@ -300,6 +300,10 @@ static inline const char *lua_push_printf(lua_State *L, const char *fmt, ...)
return ret;
}
/** The current time in monotonic milliseconds.
*
* \note it may be outdated in case of long callbacks; see uv_now().
*/
KR_EXPORT
uint64_t kr_now();
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment