mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
updated ChangeLog, AUTHORS and addressed formatting
This commit is contained in:
parent
c7b8c27575
commit
1f498cc6f2
1
AUTHORS
1
AUTHORS
@ -193,6 +193,7 @@ We have received the following contributions:
|
|||||||
|
|
||||||
- Franciszek Gorski
|
- Franciszek Gorski
|
||||||
2018-10: Makefile bug fixed
|
2018-10: Makefile bug fixed
|
||||||
|
2019-07: Statistics enhancements
|
||||||
|
|
||||||
- Suzanne Goldlust
|
- Suzanne Goldlust
|
||||||
2018-10: API documentation
|
2018-10: API documentation
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
1620. [func] franek, razvan
|
||||||
|
Kea statistics improvements: Support for storing more than one
|
||||||
|
sample.
|
||||||
|
(Gitlab #696,!418, git c7b8c275758c96f56081e02da429f5dd9d653b87)
|
||||||
|
|
||||||
1619. [func] marcin
|
1619. [func] marcin
|
||||||
Add support for associating subnets with the server tags in the
|
Add support for associating subnets with the server tags in the
|
||||||
mysql_cb hooks library.
|
mysql_cb hooks library.
|
||||||
|
@ -247,7 +247,8 @@ std::list<StringSample> Observation::getStrings() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename SampleType, typename Storage>
|
template<typename SampleType, typename Storage>
|
||||||
std::list<SampleType> Observation::getValuesInternal(Storage& storage, Type exp_type) const {
|
std::list<SampleType> Observation::getValuesInternal(Storage& storage,
|
||||||
|
Type exp_type) const {
|
||||||
if (type_ != exp_type) {
|
if (type_ != exp_type) {
|
||||||
isc_throw(InvalidStatType, "Invalid statistic type requested: "
|
isc_throw(InvalidStatType, "Invalid statistic type requested: "
|
||||||
<< typeToText(exp_type) << ", but the actual type is "
|
<< typeToText(exp_type) << ", but the actual type is "
|
||||||
@ -265,7 +266,8 @@ std::list<SampleType> Observation::getValuesInternal(Storage& storage, Type exp_
|
|||||||
|
|
||||||
template<typename StorageType>
|
template<typename StorageType>
|
||||||
void Observation::setMaxSampleAgeInternal(StorageType& storage,
|
void Observation::setMaxSampleAgeInternal(StorageType& storage,
|
||||||
const StatsDuration& duration, Type exp_type) {
|
const StatsDuration& duration,
|
||||||
|
Type exp_type) {
|
||||||
if (type_ != exp_type) {
|
if (type_ != exp_type) {
|
||||||
isc_throw(InvalidStatType, "Invalid statistic type requested: "
|
isc_throw(InvalidStatType, "Invalid statistic type requested: "
|
||||||
<< typeToText(exp_type) << ", but the actual type is "
|
<< typeToText(exp_type) << ", but the actual type is "
|
||||||
@ -289,7 +291,8 @@ void Observation::setMaxSampleAgeInternal(StorageType& storage,
|
|||||||
|
|
||||||
template<typename StorageType>
|
template<typename StorageType>
|
||||||
void Observation::setMaxSampleCountInternal(StorageType& storage,
|
void Observation::setMaxSampleCountInternal(StorageType& storage,
|
||||||
uint32_t max_samples, Type exp_type) {
|
uint32_t max_samples,
|
||||||
|
Type exp_type) {
|
||||||
if (type_ != exp_type) {
|
if (type_ != exp_type) {
|
||||||
isc_throw(InvalidStatType, "Invalid statistic type requested: "
|
isc_throw(InvalidStatType, "Invalid statistic type requested: "
|
||||||
<< typeToText(exp_type) << ", but the actual type is "
|
<< typeToText(exp_type) << ", but the actual type is "
|
||||||
|
@ -121,10 +121,10 @@ class Observation {
|
|||||||
///
|
///
|
||||||
/// @param duration determines maximum age of samples
|
/// @param duration determines maximum age of samples
|
||||||
/// Example:
|
/// Example:
|
||||||
/// To set a statistic to keep observations for the last 5 minutes,
|
/// To set a statistic to keep observations for the last 5 minutes, call:
|
||||||
/// call: setMaxSampleAge(time_duration(0, 5, 0, 0));
|
/// setMaxSampleAge(time_duration(0, 5, 0, 0));
|
||||||
/// To revert statistic to a single value, call:
|
/// To revert statistic to a single value, call:
|
||||||
/// setMaxSampleAge(time_duration(0, 0, 0, 0))
|
/// setMaxSampleAge(time_duration(0, 0, 0, 0));
|
||||||
void setMaxSampleAge(const StatsDuration& duration);
|
void setMaxSampleAge(const StatsDuration& duration);
|
||||||
|
|
||||||
/// @brief Determines how many samples of a given statistic should be kept.
|
/// @brief Determines how many samples of a given statistic should be kept.
|
||||||
@ -134,6 +134,7 @@ class Observation {
|
|||||||
/// be kept. When adding max_samples + 1 sample, the oldest sample will be
|
/// be kept. When adding max_samples + 1 sample, the oldest sample will be
|
||||||
/// discarded.
|
/// discarded.
|
||||||
///
|
///
|
||||||
|
///
|
||||||
/// @param max_samples how many samples of a given statistic should be kept
|
/// @param max_samples how many samples of a given statistic should be kept
|
||||||
/// Example:
|
/// Example:
|
||||||
/// To set a statistic to keep the last 100 observations, call:
|
/// To set a statistic to keep the last 100 observations, call:
|
||||||
@ -268,7 +269,7 @@ private:
|
|||||||
/// @tparam Storage type of storage (e.g. list<IntegerSample>)
|
/// @tparam Storage type of storage (e.g. list<IntegerSample>)
|
||||||
/// @param storage storage which size will be returned
|
/// @param storage storage which size will be returned
|
||||||
/// @param exp_type expected observation type (used for sanity checking)
|
/// @param exp_type expected observation type (used for sanity checking)
|
||||||
/// @return Size of storage
|
/// @return size of storage
|
||||||
template<typename StorageType>
|
template<typename StorageType>
|
||||||
size_t getSizeInternal(StorageType& storage, Type exp_type) const;
|
size_t getSizeInternal(StorageType& storage, Type exp_type) const;
|
||||||
|
|
||||||
@ -306,7 +307,7 @@ private:
|
|||||||
/// @param observation storage
|
/// @param observation storage
|
||||||
/// @param exp_type expected observation type (used for sanity checking)
|
/// @param exp_type expected observation type (used for sanity checking)
|
||||||
/// @throw InvalidStatType if observation type mismatches
|
/// @throw InvalidStatType if observation type mismatches
|
||||||
/// @return List of observed samples
|
/// @return list of observed samples
|
||||||
template<typename SampleType, typename Storage>
|
template<typename SampleType, typename Storage>
|
||||||
std::list<SampleType> getValuesInternal(Storage& storage,
|
std::list<SampleType> getValuesInternal(Storage& storage,
|
||||||
Type exp_type) const;
|
Type exp_type) const;
|
||||||
@ -338,7 +339,7 @@ private:
|
|||||||
Type type_;
|
Type type_;
|
||||||
|
|
||||||
/// @brief Maximum number of samples
|
/// @brief Maximum number of samples
|
||||||
/// The limit is represent as a pair
|
/// The limit is represented as a pair
|
||||||
/// of bool value and uint32_t
|
/// of bool value and uint32_t
|
||||||
/// Only one kind of limit can be active
|
/// Only one kind of limit can be active
|
||||||
/// The bool value informs which limit
|
/// The bool value informs which limit
|
||||||
@ -349,7 +350,7 @@ private:
|
|||||||
std::pair<bool, uint32_t> max_sample_count_ = std::make_pair(true, 20);
|
std::pair<bool, uint32_t> max_sample_count_ = std::make_pair(true, 20);
|
||||||
|
|
||||||
/// @brief Maximum timespan of samples
|
/// @brief Maximum timespan of samples
|
||||||
/// The limit is represent as a pair
|
/// The limit is represented as a pair
|
||||||
/// of bool value and StatsDuration(boost::posix_time::time_duration)
|
/// of bool value and StatsDuration(boost::posix_time::time_duration)
|
||||||
/// Only one kind of limit can be active
|
/// Only one kind of limit can be active
|
||||||
/// The bool value informs which limit
|
/// The bool value informs which limit
|
||||||
|
@ -90,7 +90,8 @@ bool StatsMgr::setMaxSampleAge(const std::string& name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StatsMgr::setMaxSampleCount(const std::string& name, uint32_t max_samples) {
|
bool StatsMgr::setMaxSampleCount(const std::string& name,
|
||||||
|
uint32_t max_samples) {
|
||||||
ObservationPtr obs = getObservation(name);
|
ObservationPtr obs = getObservation(name);
|
||||||
if (obs) {
|
if (obs) {
|
||||||
obs->setMaxSampleCount(max_samples);
|
obs->setMaxSampleCount(max_samples);
|
||||||
|
@ -138,10 +138,11 @@ class StatsMgr : public boost::noncopyable {
|
|||||||
/// @param name name of the observation
|
/// @param name name of the observation
|
||||||
/// @param duration determines maximum age of samples
|
/// @param duration determines maximum age of samples
|
||||||
/// @return true if successful, false if there's no such statistic
|
/// @return true if successful, false if there's no such statistic
|
||||||
/// Example: to set a statistic to keep observations for the last 5 minutes,
|
/// Example:
|
||||||
/// call setMaxSampleAge("incoming-packets", time_duration(0, 5, 0, 0));
|
/// To set a statistic to keep observations for the last 5 minutes, call:
|
||||||
|
/// setMaxSampleAge("incoming-packets", time_duration(0, 5, 0, 0));
|
||||||
/// to revert statistic to a single value, call:
|
/// to revert statistic to a single value, call:
|
||||||
/// setMaxSampleAge("incoming-packets" time_duration(0, 0, 0, 0))
|
/// setMaxSampleAge("incoming-packets", time_duration(0, 0, 0, 0));
|
||||||
bool setMaxSampleAge(const std::string& name, const StatsDuration& duration);
|
bool setMaxSampleAge(const std::string& name, const StatsDuration& duration);
|
||||||
|
|
||||||
/// @brief Determines how many samples of a given statistic should be kept.
|
/// @brief Determines how many samples of a given statistic should be kept.
|
||||||
|
@ -493,7 +493,6 @@ TEST_F(ObservationTest, floatToJSON) {
|
|||||||
// See https://gitlab.isc.org/isc-projects/kea/wikis/designs/Stats-design for
|
// See https://gitlab.isc.org/isc-projects/kea/wikis/designs/Stats-design for
|
||||||
// details.
|
// details.
|
||||||
TEST_F(ObservationTest, durationToJSON) {
|
TEST_F(ObservationTest, durationToJSON) {
|
||||||
|
|
||||||
// String which contains first added sample
|
// String which contains first added sample
|
||||||
std::string first_sample = ", \"01:02:03.000004\", \"" +
|
std::string first_sample = ", \"01:02:03.000004\", \"" +
|
||||||
isc::util::ptimeToText(c.getDuration().second) + "\" ] ]";
|
isc::util::ptimeToText(c.getDuration().second) + "\" ] ]";
|
||||||
@ -515,6 +514,7 @@ TEST_F(ObservationTest, stringToJSON) {
|
|||||||
// String which contains first added sample
|
// String which contains first added sample
|
||||||
std::string first_sample = ", \"1234\", \"" +
|
std::string first_sample = ", \"1234\", \"" +
|
||||||
isc::util::ptimeToText(d.getString().second) + "\" ] ]";
|
isc::util::ptimeToText(d.getString().second) + "\" ] ]";
|
||||||
|
|
||||||
d.setValue("Lorem ipsum dolor sit amet");
|
d.setValue("Lorem ipsum dolor sit amet");
|
||||||
|
|
||||||
std::string exp = "[ [ \"Lorem ipsum dolor sit amet\", \"" +
|
std::string exp = "[ [ \"Lorem ipsum dolor sit amet\", \"" +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user