Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
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
trackrdrd
Commits
439bb769
Commit
439bb769
authored
Dec 17, 2012
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trackrdrd: do not insert partial records, only records seen from ReqStart
parent
d45589c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
45 deletions
+33
-45
trackrdrd.c
trackrdrd/src/trackrdrd.c
+33
-45
No files found.
trackrdrd/src/trackrdrd.c
View file @
439bb769
...
...
@@ -129,55 +129,25 @@ submit(unsigned xid)
}
static
inline
dataentry
*
insert
(
unsigned
xid
,
enum
VSL_tag_e
tag
,
unsigned
fd
)
{
dataentry
*
entry
;
entry
=
DATA_Insert
(
xid
);
if
(
entry
==
NULL
)
{
LOG_Log
(
LOG_ALERT
,
"%s: Cannot insert data, XID=%d tid=%d DISCARDED"
,
VSL_tags
[
tag
],
xid
,
fd
);
return
NULL
;
}
CHECK_OBJ
(
entry
,
DATA_MAGIC
);
entry
->
state
=
DATA_OPEN
;
entry
->
xid
=
xid
;
entry
->
tid
=
fd
;
entry
->
hasdata
=
false
;
sprintf
(
entry
->
data
,
"XID=%d"
,
xid
);
entry
->
end
=
strlen
(
entry
->
data
);
if
(
entry
->
end
>
tbl
.
data_hi
)
tbl
.
data_hi
=
entry
->
end
;
MON_StatsUpdate
(
STATS_OCCUPANCY
);
return
entry
;
}
static
inline
dataentry
*
find_or_insert
(
unsigned
xid
,
enum
VSL_tag_e
tag
,
unsigned
fd
)
*
find
(
unsigned
xid
,
enum
VSL_tag_e
tag
,
unsigned
fd
,
const
char
*
ptr
,
unsigned
len
)
{
dataentry
*
entry
;
entry
=
DATA_Find
(
xid
);
if
(
entry
==
NULL
)
{
if
(
term
)
return
NULL
;
LOG_Log
(
LOG_WARNING
,
"%s: XID %d not found, attempting insert"
,
VSL_tags
[
tag
],
xid
);
tbl
.
seen
++
;
entry
=
insert
(
xid
,
tag
,
fd
);
if
(
entry
==
NULL
)
return
NULL
;
}
else
{
CHECK_OBJ_NOTNULL
(
entry
,
DATA_MAGIC
);
assert
(
entry
->
xid
==
xid
);
assert
(
entry
->
tid
==
fd
);
assert
(
entry
->
state
==
DATA_OPEN
);
if
(
!
term
)
LOG_Log
(
LOG_WARNING
,
"%s: XID %d not found, fd=%d, DISCARDING [%.*s]"
,
VSL_tags
[
tag
],
xid
,
fd
,
len
,
ptr
);
return
NULL
;
}
CHECK_OBJ
(
entry
,
DATA_MAGIC
);
assert
(
entry
->
xid
==
xid
);
assert
(
entry
->
tid
==
fd
);
assert
(
entry
->
state
==
DATA_OPEN
);
return
entry
;
}
...
...
@@ -236,7 +206,25 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
AZ
(
err
);
LOG_Log
(
LOG_DEBUG
,
"%s: XID=%d"
,
VSL_tags
[
tag
],
xid
);
(
void
)
insert
(
xid
,
tag
,
fd
);
entry
=
DATA_Insert
(
xid
);
if
(
entry
==
NULL
)
{
LOG_Log
(
LOG_ALERT
,
"%s: Cannot insert data, XID=%d tid=%d DISCARDED"
,
VSL_tags
[
tag
],
xid
,
fd
);
break
;
}
CHECK_OBJ
(
entry
,
DATA_MAGIC
);
entry
->
state
=
DATA_OPEN
;
entry
->
xid
=
xid
;
entry
->
tid
=
fd
;
entry
->
hasdata
=
false
;
sprintf
(
entry
->
data
,
"XID=%d"
,
xid
);
entry
->
end
=
strlen
(
entry
->
data
);
if
(
entry
->
end
>
tbl
.
data_hi
)
tbl
.
data_hi
=
entry
->
end
;
MON_StatsUpdate
(
STATS_OCCUPANCY
);
break
;
case
SLT_VCL_Log
:
...
...
@@ -250,7 +238,7 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
LOG_Log
(
LOG_DEBUG
,
"%s: XID=%d, data=[%.*s]"
,
VSL_tags
[
tag
],
xid
,
datalen
,
data
);
entry
=
find
_or_insert
(
xid
,
tag
,
fd
);
entry
=
find
(
xid
,
tag
,
fd
,
ptr
,
len
);
if
(
entry
==
NULL
)
break
;
...
...
@@ -265,7 +253,7 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
LOG_Log
(
LOG_DEBUG
,
"%s: XID=%d req_endt=%u.%09lu"
,
VSL_tags
[
tag
],
xid
,
(
unsigned
)
reqend_t
.
tv_sec
,
reqend_t
.
tv_nsec
);
entry
=
find
_or_insert
(
xid
,
tag
,
fd
);
entry
=
find
(
xid
,
tag
,
fd
,
ptr
,
len
);
if
(
entry
==
NULL
)
break
;
sprintf
(
reqend_str
,
"%s=%u.%09lu"
,
REQEND_T_VAR
,
...
...
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