Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. # To allow inline-C in VCL start varnishd with -p vcc_allow_inline_c=on
  2. C{
  3. #include <sys/time.h>
  4. #include <stdio.h>
  5. static const struct gethdr_s VGC_HDR_REQ_reqstart = { HDR_REQ, "\020X-Request-Start:" };
  6. }C
  7.  
  8. sub vcl_recv {
  9. # Add X-Request-Start header for New Relic queue time analytics
  10. C{
  11. struct timeval detail_time;
  12. gettimeofday(&detail_time, NULL);
  13. char start[20];
  14. sprintf(start, "t=%lu%06lu", detail_time.tv_sec, detail_time.tv_usec);
  15. VRT_SetHdr(ctx, &VGC_HDR_REQ_reqstart, start, vrt_magic_string_end);
  16. }C
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement