Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
varnishevent
Commits
42b61b35
Commit
42b61b35
authored
Sep 14, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add stats to the writer measuring time spent polling and writing
parent
58ed9e04
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
writer.c
src/writer.c
+13
-4
No files found.
src/writer.c
View file @
42b61b35
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include "miniobj.h"
#include "miniobj.h"
#include "vsb.h"
#include "vsb.h"
#include "vmb.h"
#include "vmb.h"
#include "vtim.h"
typedef
enum
{
typedef
enum
{
WRT_NOTSTARTED
=
0
,
WRT_NOTSTARTED
=
0
,
...
@@ -88,6 +89,7 @@ static unsigned long waits = 0;
...
@@ -88,6 +89,7 @@ static unsigned long waits = 0;
static
unsigned
long
writes
=
0
;
static
unsigned
long
writes
=
0
;
static
unsigned
long
errors
=
0
;
static
unsigned
long
errors
=
0
;
static
unsigned
long
timeouts
=
0
;
static
unsigned
long
timeouts
=
0
;
static
double
pollt
=
0
.,
writet
=
0
.;
typedef
struct
writer_data_s
{
typedef
struct
writer_data_s
{
unsigned
magic
;
unsigned
magic
;
...
@@ -200,7 +202,9 @@ wrt_write(tx_t *tx)
...
@@ -200,7 +202,9 @@ wrt_write(tx_t *tx)
ready
=
0
;
ready
=
0
;
do
{
do
{
double
start
=
VTIM_mono
();
nfds
=
poll
(
fds
,
1
,
timeout
);
nfds
=
poll
(
fds
,
1
,
timeout
);
pollt
+=
VTIM_mono
()
-
start
;
if
(
nfds
<
0
)
if
(
nfds
<
0
)
assert
(
errno
==
EAGAIN
||
errno
==
EINTR
);
assert
(
errno
==
EAGAIN
||
errno
==
EINTR
);
}
while
(
nfds
<
0
);
}
while
(
nfds
<
0
);
...
@@ -226,7 +230,10 @@ wrt_write(tx_t *tx)
...
@@ -226,7 +230,10 @@ wrt_write(tx_t *tx)
}
}
}
}
if
(
ready
)
{
if
(
ready
)
{
if
(
fprintf
(
fo
,
"%s"
,
VSB_data
(
os
))
<
0
)
{
double
start
=
VTIM_mono
();
int
ret
=
fprintf
(
fo
,
"%s"
,
VSB_data
(
os
));
writet
+=
VTIM_mono
()
-
start
;
if
(
ret
<
0
)
{
LOG_Log
(
LOG_ERR
,
"Output error %d (%s), DATA DISCARDED: %s"
,
LOG_Log
(
LOG_ERR
,
"Output error %d (%s), DATA DISCARDED: %s"
,
errno
,
strerror
(
errno
),
VSB_data
(
os
));
errno
,
strerror
(
errno
),
VSB_data
(
os
));
errors
++
;
errors
++
;
...
@@ -353,9 +360,11 @@ WRT_Stats(void)
...
@@ -353,9 +360,11 @@ WRT_Stats(void)
{
{
LOG_Log
(
LOG_INFO
,
LOG_Log
(
LOG_INFO
,
"Writer (%s): seen=%lu writes=%lu bytes=%lu errors=%lu timeouts=%lu"
"Writer (%s): seen=%lu writes=%lu bytes=%lu errors=%lu timeouts=%lu"
" waits=%lu free_tx=%u free_rec=%u free_chunk=%u"
,
" waits=%lu free_tx=%u free_rec=%u free_chunk=%u pollt=%.6f"
" writet=%.6f"
,
statename
[
wrt_data
.
state
],
deqs
,
writes
,
bytes
,
errors
,
timeouts
,
statename
[
wrt_data
.
state
],
deqs
,
writes
,
bytes
,
errors
,
timeouts
,
waits
,
wrt_nfree_tx
,
wrt_nfree_recs
,
wrt_nfree_chunks
);
waits
,
wrt_nfree_tx
,
wrt_nfree_recs
,
wrt_nfree_chunks
,
pollt
,
writet
);
}
}
int
int
...
...
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