Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
0a64e73a
Unverified
Commit
0a64e73a
authored
Dec 03, 2018
by
Lasse Karstensen
Committed by
GitHub
Dec 03, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2741 from lkarsten/varnishstat_refresh_interval
Make it possible to change ncurses update rate.
parents
8f5d9212
c510b331
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
6 deletions
+42
-6
varnishstat.c
bin/varnishstat/varnishstat.c
+1
-1
varnishstat.h
bin/varnishstat/varnishstat.h
+1
-1
varnishstat_curses.c
bin/varnishstat/varnishstat_curses.c
+24
-3
u00008.vtc
bin/varnishtest/tests/u00008.vtc
+9
-1
varnishstat.rst
doc/sphinx/reference/varnishstat.rst
+7
-0
No files found.
bin/varnishstat/varnishstat.c
View file @
0a64e73a
...
@@ -324,7 +324,7 @@ main(int argc, char * const *argv)
...
@@ -324,7 +324,7 @@ main(int argc, char * const *argv)
AN
(
VSC_Arg
(
vsc
,
'f'
,
"MAIN.cache_hit"
));
AN
(
VSC_Arg
(
vsc
,
'f'
,
"MAIN.cache_hit"
));
AN
(
VSC_Arg
(
vsc
,
'f'
,
"MAIN.cache_miss"
));
AN
(
VSC_Arg
(
vsc
,
'f'
,
"MAIN.cache_miss"
));
}
}
do_curses
(
vd
,
vsc
,
1
.
0
);
do_curses
(
vd
,
vsc
);
}
}
else
if
(
xml
)
else
if
(
xml
)
do_xml
(
vd
,
vsc
);
do_xml
(
vd
,
vsc
);
...
...
bin/varnishstat/varnishstat.h
View file @
0a64e73a
...
@@ -35,4 +35,4 @@
...
@@ -35,4 +35,4 @@
#include "vas.h"
#include "vas.h"
#include "vcs.h"
#include "vcs.h"
void
do_curses
(
struct
vsm
*
,
struct
vsc
*
,
double
);
void
do_curses
(
struct
vsm
*
,
struct
vsc
*
);
bin/varnishstat/varnishstat_curses.c
View file @
0a64e73a
...
@@ -120,6 +120,10 @@ static double t_sample = 0.;
...
@@ -120,6 +120,10 @@ static double t_sample = 0.;
static
double
interval
=
1
.;
static
double
interval
=
1
.;
static
unsigned
vsm_status
=
0
;
static
unsigned
vsm_status
=
0
;
#define NOTIF_MAXLEN 256
static
char
notification_message
[
NOTIF_MAXLEN
]
=
""
;
static
double
notification_eol
=
0
.
0
;
static
void
static
void
init_hitrate
(
void
)
init_hitrate
(
void
)
{
{
...
@@ -435,6 +439,9 @@ draw_status(void)
...
@@ -435,6 +439,9 @@ draw_status(void)
mvwprintw
(
w_status
,
1
,
0
,
"Uptime child: "
);
mvwprintw
(
w_status
,
1
,
0
,
"Uptime child: "
);
running
(
w_status
,
up_chld
,
VSM_WRK_RUNNING
);
running
(
w_status
,
up_chld
,
VSM_WRK_RUNNING
);
if
(
VTIM_mono
()
<
notification_eol
)
mvwaddstr
(
w_status
,
2
,
0
,
notification_message
);
if
(
COLS
>
70
)
{
if
(
COLS
>
70
)
{
mvwprintw
(
w_status
,
0
,
getmaxx
(
w_status
)
-
37
,
mvwprintw
(
w_status
,
0
,
getmaxx
(
w_status
)
-
37
,
"Hitrate n: %8u %8u %8u"
,
hitrate
.
hr_10
.
n
,
hitrate
.
hr_100
.
n
,
"Hitrate n: %8u %8u %8u"
,
hitrate
.
hr_10
.
n
,
hitrate
.
hr_100
.
n
,
...
@@ -899,6 +906,22 @@ handle_keypress(int ch)
...
@@ -899,6 +906,22 @@ handle_keypress(int ch)
current
=
n_ptarray
-
1
;
current
=
n_ptarray
-
1
;
page_start
=
(
current
-
l_points
)
+
1
;
page_start
=
(
current
-
l_points
)
+
1
;
break
;
break
;
case
'+'
:
interval
+=
0
.
1
;
(
void
)
snprintf
(
notification_message
,
NOTIF_MAXLEN
,
"Refresh interval set to %.1f seconds."
,
interval
);
notification_eol
=
VTIM_mono
()
+
1
.
25
;
break
;
case
'-'
:
interval
-=
0
.
1
;
if
(
interval
<
0
.
1
)
interval
=
0
.
1
;
(
void
)
snprintf
(
notification_message
,
NOTIF_MAXLEN
,
"Refresh interval set to %.1f seconds."
,
interval
);
notification_eol
=
VTIM_mono
()
+
1
.
25
;
break
;
case
'v'
:
case
'v'
:
verbosity
=
VSC_ChangeLevel
(
verbosity
,
1
);
verbosity
=
VSC_ChangeLevel
(
verbosity
,
1
);
rebuild
=
1
;
rebuild
=
1
;
...
@@ -980,14 +1003,12 @@ delpt(void *priv, const struct VSC_point *const vpt)
...
@@ -980,14 +1003,12 @@ delpt(void *priv, const struct VSC_point *const vpt)
}
}
void
void
do_curses
(
struct
vsm
*
vsm
,
struct
vsc
*
vsc
,
double
delay
)
do_curses
(
struct
vsm
*
vsm
,
struct
vsc
*
vsc
)
{
{
long
t
;
long
t
;
int
ch
;
int
ch
;
double
now
;
double
now
;
interval
=
delay
;
verbosity
=
VSC_ChangeLevel
(
NULL
,
0
);
verbosity
=
VSC_ChangeLevel
(
NULL
,
0
);
initscr
();
initscr
();
...
...
bin/varnishtest/tests/u00008.vtc
View file @
0a64e73a
varnishtest
"trivial run of varni
stat in curses mode"
varnishtest
"trivial run of varnish
stat in curses mode"
server s1 -repeat 4 {
server s1 -repeat 4 {
rxreq
rxreq
...
@@ -24,6 +24,14 @@ client c1 {
...
@@ -24,6 +24,14 @@ client c1 {
process p1 -expect-text 0 0 "MAIN.s_sess"
process p1 -expect-text 0 0 "MAIN.s_sess"
process p1 -screen_dump
process p1 -screen_dump
process p1 -write {+}
process p1 -screen_dump
process p1 -expect-text 0 0 "Refresh interval set to 1.1 seconds."
process p1 -write {-}
process p1 -screen_dump
process p1 -expect-text 0 0 "Refresh interval set to 1.0 seconds."
process p1 -write {vG}
process p1 -write {vG}
process p1 -expect-text 0 0 "VBE.vcl1.s1.req"
process p1 -expect-text 0 0 "VBE.vcl1.s1.req"
process p1 -expect-text 0 0 "DIAG"
process p1 -expect-text 0 0 "DIAG"
...
...
doc/sphinx/reference/varnishstat.rst
View file @
0a64e73a
...
@@ -109,6 +109,13 @@ The following keys control the interactive display:
...
@@ -109,6 +109,13 @@ The following keys control the interactive display:
<CTRL+T>
<CTRL+T>
Sample now.
Sample now.
<+>
Increase refresh interval.
<->
Decrease refresh interval.
OUTPUTS
OUTPUTS
=======
=======
...
...
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