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
9d53b1f6
Commit
9d53b1f6
authored
Apr 01, 2020
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump the varnishstat json schema version to 2
parent
5aede725
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
19 deletions
+23
-19
varnishstat.c
bin/varnishstat/varnishstat.c
+23
-19
No files found.
bin/varnishstat/varnishstat.c
View file @
9d53b1f6
...
...
@@ -99,48 +99,52 @@ do_xml(struct vsm *vsm, struct vsc *vsc)
static
int
v_matchproto_
(
VSC_iter_f
)
do_json_cb
(
void
*
priv
,
const
struct
VSC_point
*
const
pt
)
{
uint64_t
val
;
int
*
jp
;
const
char
**
sep
;
uintmax_t
val
;
if
(
pt
==
NULL
)
return
(
0
);
jp
=
priv
;
AZ
(
strcmp
(
pt
->
ctype
,
"uint64_t"
));
val
=
*
(
const
volatile
uint64_t
*
)
pt
->
ptr
;
val
=
(
uintmax_t
)
*
(
const
volatile
uint64_t
*
)
pt
->
ptr
;
if
(
*
jp
)
*
jp
=
0
;
else
printf
(
",
\n
"
);
sep
=
priv
;
printf
(
"
\"
%s
\"
: {
\n
"
,
pt
->
name
);
printf
(
"
\"
description
\"
:
\"
%s
\"
,
\n
"
,
pt
->
sdesc
);
printf
(
"%s"
"
\"
%s
\"
: {
\n
"
"
\"
description
\"
:
\"
%s
\"
,
\n
"
"
\"
flag
\"
:
\"
%c
\"
,
\n
"
"
\"
format
\"
:
\"
%c
\"
,
\n
"
"
\"
value
\"
: %ju
\n
"
" }"
,
*
sep
,
pt
->
name
,
pt
->
sdesc
,
pt
->
semantics
,
pt
->
format
,
val
);
printf
(
"
\"
flag
\"
:
\"
%c
\"
, "
,
pt
->
semantics
);
printf
(
"
\"
format
\"
:
\"
%c
\"
,
\n
"
,
pt
->
format
);
printf
(
"
\"
value
\"
: %ju"
,
(
uintmax_t
)
val
);
printf
(
"
\n
}"
);
*
sep
=
",
\n
"
;
return
(
0
);
}
static
void
do_json
(
struct
vsm
*
vsm
,
struct
vsc
*
vsc
)
{
const
char
*
sep
;
char
time_stamp
[
20
];
time_t
now
;
int
jp
;
jp
=
1
;
sep
=
""
;
now
=
time
(
NULL
);
(
void
)
strftime
(
time_stamp
,
20
,
"%Y-%m-%dT%H:%M:%S"
,
localtime
(
&
now
));
printf
(
"{
\n
"
printf
(
"{
\n
"
"
\"
version
\"
: 1,
\n
"
"
\"
timestamp
\"
:
\"
%s
\"
,
\n
"
"
\"
counters
\"
: {
\n
"
,
time_stamp
);
(
void
)
VSC_Iter
(
vsc
,
vsm
,
do_json_cb
,
&
jp
);
printf
(
"
\n
}
\n
}
\n
"
);
(
void
)
VSC_Iter
(
vsc
,
vsm
,
do_json_cb
,
&
sep
);
printf
(
"
\n
"
" }
\n
"
"}
\n
"
);
}
...
...
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