Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
trackrdrd
Commits
91bb1902
Commit
91bb1902
authored
Dec 06, 2012
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trackrdrd: monitor.interval in whole second precision
parent
785079bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
22 deletions
+10
-22
config.c
trackrdrd/src/config.c
+6
-17
monitor.c
trackrdrd/src/monitor.c
+3
-4
trackrdrd.h
trackrdrd/src/trackrdrd.h
+1
-1
No files found.
trackrdrd/src/config.c
View file @
91bb1902
...
...
@@ -118,6 +118,7 @@ CONF_Add(const char *lval, const char *rval)
confUnsigned
(
"maxdata.scale"
,
maxdata_scale
);
confUnsigned
(
"nworkers"
,
nworkers
);
confUnsigned
(
"restarts"
,
restarts
);
confUnsigned
(
"monitor.interval"
,
monitor_interval
);
if
(
strcmp
(
lval
,
"syslog.facility"
)
==
0
)
{
if
((
ret
=
conf_getFacility
(
rval
))
<
0
)
...
...
@@ -129,18 +130,6 @@ CONF_Add(const char *lval, const char *rval)
return
(
0
);
}
if
(
strcmp
(
lval
,
"monitor.interval"
)
==
0
)
{
char
*
p
;
errno
=
0
;
double
d
=
strtod
(
rval
,
&
p
);
if
(
errno
)
return
(
errno
);
if
(
strlen
(
p
)
!=
0
||
d
<
0
||
!
isfinite
(
d
))
return
(
EINVAL
);
config
.
monitor_interval
=
d
;
return
(
0
);
}
if
(
strcmp
(
lval
,
"user"
)
==
0
)
{
struct
passwd
*
pw
;
...
...
@@ -289,14 +278,14 @@ CONF_Dump(void)
strcmp
(
config
.
log_file
,
"-"
)
==
0
?
"stdout"
:
config
.
log_file
);
confdump
(
"varnish.bindump = %s"
,
config
.
varnish_bindump
);
confdump
(
"syslog.facility = %s"
,
config
.
syslog_facility_name
);
confdump
(
"monitor.interval = %
.1f
"
,
config
.
monitor_interval
);
confdump
(
"monitor.interval = %
u
"
,
config
.
monitor_interval
);
confdump
(
"monitor.workers = %s"
,
config
.
monitor_workers
?
"true"
:
"false"
);
confdump
(
"processor.log = %s"
,
config
.
processor_log
);
confdump
(
"maxopen.scale = %
d
"
,
config
.
maxopen_scale
);
confdump
(
"maxdata.scale = %
d
"
,
config
.
maxdata_scale
);
confdump
(
"maxopen.scale = %
u
"
,
config
.
maxopen_scale
);
confdump
(
"maxdata.scale = %
u
"
,
config
.
maxdata_scale
);
confdump
(
"mq.uri = %s"
,
config
.
mq_uri
);
confdump
(
"mq.qname = %s"
,
config
.
mq_qname
);
confdump
(
"nworkers = %
d
"
,
config
.
nworkers
);
confdump
(
"restarts = %
d
"
,
config
.
restarts
);
confdump
(
"nworkers = %
u
"
,
config
.
nworkers
);
confdump
(
"restarts = %
u
"
,
config
.
restarts
);
confdump
(
"user = %s"
,
config
.
user_name
);
}
trackrdrd/src/monitor.c
View file @
91bb1902
...
...
@@ -70,12 +70,11 @@ void
*
MON_StatusThread
(
void
*
arg
)
{
struct
timespec
t
;
double
*
interval
=
(
double
*
)
arg
;
unsigned
*
interval
=
(
unsigned
*
)
arg
;
t
.
tv_sec
=
(
time_t
)
*
interval
;
t
.
tv_nsec
=
(
long
)(
t
.
tv_sec
-
*
interval
)
*
10e9
;
LOG_Log
(
LOG_INFO
,
"Monitor thread running every %.2f secs"
,
t
.
tv_sec
+
((
float
)
t
.
tv_nsec
*
10e-9
));
t
.
tv_nsec
=
0
;
LOG_Log
(
LOG_INFO
,
"Monitor thread running every %u secs"
,
t
.
tv_sec
);
run
=
1
;
pthread_cleanup_push
(
monitor_cleanup
,
arg
);
...
...
trackrdrd/src/trackrdrd.h
View file @
91bb1902
...
...
@@ -152,7 +152,7 @@ struct config {
char
varnish_bindump
[
BUFSIZ
];
int
syslog_facility
;
char
syslog_facility_name
[
BUFSIZ
];
double
monitor_interval
;
unsigned
monitor_interval
;
bool
monitor_workers
;
char
processor_log
[
BUFSIZ
];
unsigned
maxopen_scale
;
...
...
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