BIND 10 trac452, updated. 2931606d7c3d6709284788890b016ff434d0f5e2 Modified configuration variable "statistics-interval" to accept interval in seconds.
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Feb 2 12:12:18 UTC 2011
The branch, trac452 has been updated
via 2931606d7c3d6709284788890b016ff434d0f5e2 (commit)
from 3aa87f6826846585666e907b446a3809ccfce560 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2931606d7c3d6709284788890b016ff434d0f5e2
Author: Yoshitaka Aharen <aharen at jprs.co.jp>
Date: Wed Feb 2 21:02:53 2011 +0900
Modified configuration variable "statistics-interval" to accept interval in seconds.
Upper limit for the value is also introduced; 86400 seconds.
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/auth.spec.pre.in | 2 +-
src/bin/auth/auth_srv.cc | 11 ++++++++---
src/bin/auth/auth_srv.h | 10 +++++-----
src/bin/auth/config.cc | 4 ++++
4 files changed, 18 insertions(+), 9 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/auth.spec.pre.in b/src/bin/auth/auth.spec.pre.in
index 0f0d475..8a77455 100644
--- a/src/bin/auth/auth.spec.pre.in
+++ b/src/bin/auth/auth.spec.pre.in
@@ -56,7 +56,7 @@
{ "item_name": "statistics-interval",
"item_type": "integer",
"item_optional": true,
- "item_default": 60000
+ "item_default": 60
}
],
"commands": [
diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc
index 26888c5..1f1b637 100644
--- a/src/bin/auth/auth_srv.cc
+++ b/src/bin/auth/auth_srv.cc
@@ -352,7 +352,7 @@ AuthSrv::setMemoryDataSrc(const isc::dns::RRClass& rrclass,
uint32_t
AuthSrv::getStatisticsTimerInterval() const {
- return (impl_->statistics_timer_.getInterval());
+ return (impl_->statistics_timer_.getInterval() / 1000);
}
void
@@ -360,19 +360,24 @@ AuthSrv::setStatisticsTimerInterval(uint32_t interval) {
if (interval == impl_->statistics_timer_.getInterval()) {
return;
}
+ if (interval > 86400) {
+ // It can't be occur since the value is checked in
+ // statisticsIntervalConfig::build().
+ isc_throw(InvalidParameter, "Too long interval: " << interval);
+ }
if (interval == 0) {
impl_->statistics_timer_.cancel();
} else {
impl_->statistics_timer_.setup(boost::bind(&AuthSrv::submitStatistics,
this),
- interval);
+ interval * 1000);
}
if (impl_->verbose_mode_) {
if (interval == 0) {
cerr << "[b10-auth] Disabled statistics timer" << endl;
} else {
cerr << "[b10-auth] Set statistics timer to " << interval
- << " milliseconds" << endl;
+ << " seconds" << endl;
}
}
}
diff --git a/src/bin/auth/auth_srv.h b/src/bin/auth/auth_srv.h
index 86cf77f..43089b9 100644
--- a/src/bin/auth/auth_srv.h
+++ b/src/bin/auth/auth_srv.h
@@ -308,8 +308,7 @@ public:
/// is shutdown.
void setStatisticsSession(isc::cc::AbstractSession* statistics_session);
- /// Return the interval of periodic submission of statistics in
- /// milliseconds.
+ /// Return the interval of periodic submission of statistics in seconds.
///
/// If the statistics submission is disabled, it returns 0.
///
@@ -319,15 +318,16 @@ public:
/// Set the interval of periodic submission of statistics.
///
/// If the specified value is non 0, the \c AuthSrv object will submit
- /// its statistics to the statistics module every \c interval milliseconds.
+ /// its statistics to the statistics module every \c interval seconds.
/// If it's 0, and \c AuthSrv currently submits statistics, the submission
- /// will be disabled.
+ /// will be disabled. \c interval must be equal to or shorter than 86400
+ /// seconds (1 day).
///
/// This method should normally not throw an exception; however, its
/// underlying library routines may involve resource allocation, and
/// when it fails it would result in a corresponding standard exception.
///
- /// \param interval The submission interval in milliseconds if non 0;
+ /// \param interval The submission interval in seconds if non 0;
/// or a value of 0 to disable the submission.
void setStatisticsTimerInterval(uint32_t interval);
diff --git a/src/bin/auth/config.cc b/src/bin/auth/config.cc
index 1f258e3..0e38834 100644
--- a/src/bin/auth/config.cc
+++ b/src/bin/auth/config.cc
@@ -182,6 +182,10 @@ public:
isc_throw(AuthConfigError, "negative statistics-interval value: "
<< config_interval);
}
+ if (config_interval > 86400) {
+ isc_throw(AuthConfigError, "too long statistics-interval value: "
+ << config_interval);
+ }
interval_ = config_interval;
}
virtual void commit() {
More information about the bind10-changes
mailing list