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
4b4411d2
Unverified
Commit
4b4411d2
authored
Feb 05, 2020
by
Guillaume Quintard
Committed by
Nils Goroll
Apr 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[vstat] new json schema
parent
ff8caf99
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
varnishstat.c
bin/varnishstat/varnishstat.c
+10
-9
No files found.
bin/varnishstat/varnishstat.c
View file @
4b4411d2
...
@@ -114,9 +114,7 @@ do_json_cb(void *priv, const struct VSC_point * const pt)
...
@@ -114,9 +114,7 @@ do_json_cb(void *priv, const struct VSC_point * const pt)
else
else
printf
(
",
\n
"
);
printf
(
",
\n
"
);
printf
(
"
\"
"
);
printf
(
"
\"
%s
\"
: {
\n
"
,
pt
->
name
);
/* build the JSON key name. */
printf
(
"%s
\"
: {
\n
"
,
pt
->
name
);
printf
(
"
\"
description
\"
:
\"
%s
\"
,
\n
"
,
pt
->
sdesc
);
printf
(
"
\"
description
\"
:
\"
%s
\"
,
\n
"
,
pt
->
sdesc
);
printf
(
"
\"
flag
\"
:
\"
%c
\"
, "
,
pt
->
semantics
);
printf
(
"
\"
flag
\"
:
\"
%c
\"
, "
,
pt
->
semantics
);
...
@@ -137,9 +135,12 @@ do_json(struct vsm *vsm, struct vsc *vsc)
...
@@ -137,9 +135,12 @@ do_json(struct vsm *vsm, struct vsc *vsc)
now
=
time
(
NULL
);
now
=
time
(
NULL
);
(
void
)
strftime
(
time_stamp
,
20
,
"%Y-%m-%dT%H:%M:%S"
,
localtime
(
&
now
));
(
void
)
strftime
(
time_stamp
,
20
,
"%Y-%m-%dT%H:%M:%S"
,
localtime
(
&
now
));
printf
(
"{
\n
\"
timestamp
\"
:
\"
%s
\"
,
\n
"
,
time_stamp
);
printf
(
"{
\n
"
"
\"
version
\"
: 1,
\n
"
"
\"
timestamp
\"
:
\"
%s
\"
,
\n
"
"
\"
counters
\"
: {
\n
"
,
time_stamp
);
(
void
)
VSC_Iter
(
vsc
,
vsm
,
do_json_cb
,
&
jp
);
(
void
)
VSC_Iter
(
vsc
,
vsm
,
do_json_cb
,
&
jp
);
printf
(
"
\n
}
\n
"
);
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