Skip to content

Instantly share code, notes, and snippets.

@ShadySQL
Forked from kimlindholm/newrelic.h
Last active August 29, 2015 14:08
Show Gist options
  • Save ShadySQL/c63465dc86a21fba9b9f to your computer and use it in GitHub Desktop.
Save ShadySQL/c63465dc86a21fba9b9f to your computer and use it in GitHub Desktop.
/*
* Add X-Request-Start header so we can track queue times in New Relic RPM
*/
#include <stdio.h>
#include <sys/time.h>
struct timeval detail_time;
gettimeofday(&detail_time, NULL);
char start[20];
sprintf(start, "t=%lu%06lu", detail_time.tv_sec, detail_time.tv_usec);
VRT_SetHdr(sp, HDR_REQ, "\020X-Request-Start:", start, vrt_magic_string_end);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment