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
480da504
Commit
480da504
authored
Mar 21, 2018
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
varnishhist -P: make graph boundary parameters optional
parent
50926acb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
varnishhist.c
bin/varnishhist/varnishhist.c
+17
-8
varnishhist_options.h
bin/varnishhist/varnishhist_options.h
+3
-2
No files found.
bin/varnishhist/varnishhist.c
View file @
480da504
...
...
@@ -549,9 +549,14 @@ main(int argc, char **argv)
"-P: '%s' is not a valid tag name"
,
optarg
);
if
(
VSL_tagflags
[
match_tag
])
VUT_Error
(
vut
,
1
,
"-P: '%s' is an unsafe or binary record"
,
optarg
);
cli_p
.
prefix
=
colon
+
1
;
colon
=
strchr
(
colon
+
1
,
':'
);
colon
=
strchr
(
colon
+
1
,
':'
);
if
(
colon
==
NULL
)
profile_error
(
optarg
);
...
...
@@ -559,20 +564,24 @@ main(int argc, char **argv)
if
(
*
cli_p
.
prefix
==
'\0'
)
cli_p
.
prefix
=
NULL
;
if
(
sscanf
(
colon
+
1
,
"%d:%d:%d"
,
&
cli_p
.
field
,
&
cli_p
.
hist_low
,
&
cli_p
.
hist_high
)
!=
3
)
if
(
sscanf
(
colon
+
1
,
"%d"
,
&
cli_p
.
field
)
!=
1
)
profile_error
(
optarg
);
if
(
VSL_tagflags
[
match_tag
])
VUT_Error
(
vut
,
1
,
"-P: '%s' is an unsafe or binary record"
,
optarg
);
cli_p
.
name
=
"custom"
;
cli_p
.
tag
=
match_tag
;
cli_p
.
hist_low
=
-
6
;
cli_p
.
hist_high
=
3
;
profile
=
NULL
;
active_profile
=
&
cli_p
;
colon
=
strchr
(
colon
+
1
,
':'
);
if
(
colon
==
NULL
)
break
;
if
(
sscanf
(
colon
+
1
,
"%d:%d"
,
&
cli_p
.
hist_low
,
&
cli_p
.
hist_high
)
!=
2
)
profile_error
(
optarg
);
break
;
case
'B'
:
timebend
=
strtod
(
optarg
,
NULL
);
...
...
bin/varnishhist/varnishhist_options.h
View file @
480da504
...
...
@@ -47,14 +47,15 @@
)
#define HIS_OPT_P \
VOPT("P:", "[-P <[cb:]tag:[prefix]:field_num
:min:max
>]", \
VOPT("P:", "[-P <[cb:]tag:[prefix]:field_num
[:min:max]
>]", \
"Custom profile definition", \
"Graph the given custom definition defined as: an optional" \
" (c)lient or (b)ackend filter (defaults to client), the" \
" tag we'll look for, a prefix to look for (can be empty," \
" but must be terminated by a colon) and the field number" \
" of the value we are interested in. min and max are the" \
" boundaries of the graph (these are power of ten)." \
" boundaries of the graph in power of ten and default to" \
" -6 and 3." \
)
#define HIS_OPT_B \
...
...
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