Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishevent3
Commits
05b93afe
Commit
05b93afe
authored
Oct 07, 2013
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
varnishevent only uses the real clock; and a bugfix for format %t
parent
73909737
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
16 deletions
+6
-16
format.c
bin/varnishevent/format.c
+5
-15
varnishevent.c
bin/varnishevent/varnishevent.c
+1
-1
No files found.
bin/varnishevent/format.c
View file @
05b93afe
...
...
@@ -65,9 +65,6 @@ typedef struct compiled_fmt_t {
static
compiled_fmt_t
cformat
,
bformat
,
zformat
;
/* Difference between the real and monotonic clocks */
static
double
TIM_real_mono_diff
;
static
char
i_arg
[
BUFSIZ
]
=
""
;
static
int
read_rx_hdr
=
0
,
read_tx_hdr
=
0
,
read_vcl_log
=
0
,
...
...
@@ -126,14 +123,11 @@ get_tm(logline_t *ll, struct tm * t) {
date_rec
=
GET_HDR
(
ll
,
rx
,
"Date"
);
}
else
if
(
B
(
ll
->
spec
))
{
if
(
TAG
(
ll
,
SLT_BackendReq
).
len
&&
(
ts
=
get_fld
(
&
TAG
(
ll
,
SLT_BackendReq
),
2
))
!=
NULL
)
tt
=
(
time_t
)
(
atol
(
ts
)
+
TIM_real_mono_diff
);
else
date_rec
=
GET_HDR
(
ll
,
tx
,
"Date"
);
if
((
date_rec
=
GET_HDR
(
ll
,
tx
,
"Date"
))
==
NULL
)
tt
=
(
time_t
)
ll
->
t
;
}
else
tt
=
(
time_t
)
(
ll
->
t
+
TIM_real_mono_diff
)
;
tt
=
(
time_t
)
ll
->
t
;
if
(
date_rec
)
tt
=
TIM_parse
(
&
date_rec
->
data
[
strlen
(
"Date: "
)]);
...
...
@@ -654,12 +648,10 @@ compile_fmt(char *format, compiled_fmt_t *fmt, unsigned spec, char *err)
add_fmt
(
fmt
,
os
,
n
,
format_t
,
NULL
,
0
);
if
(
C
(
spec
))
{
ADD_TAG
(
fmt
->
tags
,
ReqEnd
);
ADD_TAG
(
fmt
->
tags
,
RxHeader
);
}
else
if
(
B
(
spec
))
{
ADD_TAG
(
fmt
->
tags
,
BackendReq
);
ADD_TAG
(
fmt
->
tags
,
TxHeader
);
}
else
if
(
B
(
spec
))
ADD_TAG
(
fmt
->
tags
,
RxHeader
);
n
++
;
break
;
...
...
@@ -821,8 +813,6 @@ FMT_Init(char *err)
if
(
compile_fmt
(
config
.
zformat
,
&
zformat
,
0
,
err
)
!=
0
)
return
EINVAL
;
TIM_real_mono_diff
=
TIM_real
()
-
TIM_mono
();
strcpy
(
hit
,
"hit"
);
strcpy
(
miss
,
"miss"
);
strcpy
(
pass
,
"pass"
);
...
...
bin/varnishevent/varnishevent.c
View file @
05b93afe
...
...
@@ -445,7 +445,7 @@ event(void *priv, enum VSL_tag_e tag, unsigned fd,
assert
(
lp
->
vcl_log
==
NULL
||
lp
->
vcl_log
->
nrec
==
0
);
/* XXX: assert that all lp->tag[i].len == 0 ? */
t
=
TIM_
mono
();
t
=
TIM_
real
();
fd_tbl
[
fd
].
ll
=
lp
;
lp
->
state
=
DATA_OPEN
;
lp
->
t
=
t
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment