Skip to content

Commit 0d3b014

Browse files
committed
[#3253] Renamed end_event to stop_event
src/hooks/dhcp/perfmon/alarm.* src/hooks/dhcp/perfmon/monitored_duration.* src/hooks/dhcp/perfmon/tests/alarm_unittests.cc src/hooks/dhcp/perfmon/tests/monitored_duration_unittests.cc - renamed DurationKey::end_event_ to DurationKey::stop_event_
1 parent 840c8c1 commit 0d3b014

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

Diff for: src/hooks/dhcp/perfmon/alarm.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ Alarm::Alarm(uint16_t family,
2222
uint8_t query_type,
2323
uint8_t response_type,
2424
const std::string& start_event_label,
25-
const std::string& end_event_label,
25+
const std::string& stop_event_label,
2626
dhcp::SubnetID subnet_id,
2727
const Duration& low_water,
2828
const Duration& high_water,
2929
bool enabled /* = true */)
30-
: DurationKey(family, query_type, response_type, start_event_label, end_event_label, subnet_id),
30+
: DurationKey(family, query_type, response_type, start_event_label, stop_event_label, subnet_id),
3131
low_water_(low_water),
3232
high_water_(high_water),
3333
state_(enabled ? CLEAR : DISABLED),

Diff for: src/hooks/dhcp/perfmon/alarm.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ class Alarm : public DurationKey {
3232
/// @param query_type message type of the query packet
3333
/// @param response_type message type of the response packet
3434
/// @param start_event_label label of the start event
35-
/// @param end_event_label label of the end event
35+
/// @param stop_event_label label of the end event
3636
/// @param subnet_id SubnetID of the selected subnet
3737
/// @param low_water threshold below which the average duration must fall to clear the alarm
3838
/// @param high_water threshold above which the average duration must rise to trigger the alarm.
3939
/// @param enabled true sets state to CLEAR, otherwise DISABLED, defaults to true.
4040
Alarm(uint16_t family, uint8_t query_type, uint8_t response_type,
41-
const std::string& start_event_label, const std::string& end_event_label,
41+
const std::string& start_event_label, const std::string& stop_event_label,
4242
dhcp::SubnetID subnet_id,
4343
const Duration& low_water, const Duration& high_water, bool enabled = true);
4444

Diff for: src/hooks/dhcp/perfmon/monitored_duration.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ DurationKey::DurationKey(uint16_t family,
6363
uint8_t query_type,
6464
uint8_t response_type,
6565
const std::string& start_event_label,
66-
const std::string& end_event_label,
66+
const std::string& stop_event_label,
6767
dhcp::SubnetID subnet_id)
6868
: family_(family),
6969
query_type_(query_type),
7070
response_type_(response_type),
7171
start_event_label_(start_event_label),
72-
end_event_label_(end_event_label),
72+
stop_event_label_(stop_event_label),
7373
subnet_id_(subnet_id) {
7474
if (family != AF_INET && family != AF_INET6) {
7575
isc_throw (BadValue, "DurationKey: family must be AF_INET or AF_INET6");
@@ -166,7 +166,7 @@ DurationKey::getLabel() const {
166166
<< (response_type_ == DHCPV6_NOTYPE ? "NONE" : Pkt6::getName(response_type_));
167167
}
168168

169-
oss << "." << start_event_label_ << "-" << end_event_label_
169+
oss << "." << start_event_label_ << "-" << stop_event_label_
170170
<< "." << subnet_id_;
171171

172172
return (oss.str());
@@ -178,7 +178,7 @@ DurationKey::operator==(const DurationKey& other) const {
178178
(query_type_ == other.query_type_) &&
179179
(response_type_ == other.response_type_) &&
180180
(start_event_label_ == other.start_event_label_) &&
181-
(end_event_label_ == other.end_event_label_) &&
181+
(stop_event_label_ == other.stop_event_label_) &&
182182
(subnet_id_ == other.subnet_id_)
183183
);
184184
}
@@ -194,7 +194,7 @@ DurationKey::operator<(const DurationKey& other) const {
194194
(query_type_ < other.query_type_) ||
195195
(response_type_ < other.response_type_) ||
196196
(start_event_label_ < other.start_event_label_) ||
197-
(end_event_label_ < other.end_event_label_) ||
197+
(stop_event_label_ < other.stop_event_label_) ||
198198
(subnet_id_ < other.subnet_id_)
199199
);
200200
}
@@ -206,10 +206,10 @@ MonitoredDuration::MonitoredDuration(uint16_t family,
206206
uint8_t query_type,
207207
uint8_t response_type,
208208
const std::string& start_event_label,
209-
const std::string& end_event_label,
209+
const std::string& stop_event_label,
210210
dhcp::SubnetID subnet_id,
211211
const Duration& interval_duration)
212-
: DurationKey(family, query_type, response_type, start_event_label, end_event_label, subnet_id),
212+
: DurationKey(family, query_type, response_type, start_event_label, stop_event_label, subnet_id),
213213
interval_duration_(interval_duration),
214214
current_interval_(0),
215215
previous_interval_(0) {

Diff for: src/hooks/dhcp/perfmon/monitored_duration.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ typedef boost::shared_ptr<DurationDataInterval> DurationDataIntervalPtr;
127127
/// -# Query Packet Type
128128
/// -# Response Packet Type
129129
/// -# Start Event
130-
/// -# End Event
130+
/// -# Stop Event
131131
/// -# Subnet ID can be GLOBAL_SUBNET_ID for aggregate durations
132132
class DurationKey {
133133
public:
@@ -137,10 +137,10 @@ class DurationKey {
137137
/// @param query_type message type of the query packet
138138
/// @param response_type message type of the response packet
139139
/// @param start_event_label label of the start event
140-
/// @param end_event_label label of the end event
140+
/// @param stop_event_label label of the end event
141141
/// @param subnet_id id of the selected subnet
142142
DurationKey(uint16_t family, uint8_t query_type, uint8_t response_type,
143-
const std::string& start_event_label, const std::string& end_event_label,
143+
const std::string& start_event_label, const std::string& stop_event_label,
144144
dhcp::SubnetID subnet_id);
145145

146146
/// @brief Destructor
@@ -177,8 +177,8 @@ class DurationKey {
177177
/// @brief Get the end event label.
178178
///
179179
/// @return the end event label.
180-
std::string getEndEventLabel() const {
181-
return (end_event_label_);
180+
std::string getStopEventLabel() const {
181+
return (stop_event_label_);
182182
}
183183

184184
/// @brief Get the subnet id.
@@ -194,7 +194,7 @@ class DurationKey {
194194
/// The format of the string:
195195
///
196196
/// @code
197-
/// <query type>-<response type>.<start_event>-<end_event>.<subnet id>
197+
/// <query type>-<response type>.<start_event>-<stop_event>.<subnet id>
198198
///
199199
/// Example:
200200
///
@@ -254,7 +254,7 @@ class DurationKey {
254254
std::string start_event_label_;
255255

256256
/// @brief Label of the end event which ends the duration.
257-
std::string end_event_label_;
257+
std::string stop_event_label_;
258258

259259
/// @brief Subnet ID of the subnet selected during query fulfillment.
260260
isc::dhcp::SubnetID subnet_id_;
@@ -271,11 +271,11 @@ class MonitoredDuration : public DurationKey {
271271
/// @param query_type message type of the query packet
272272
/// @param response_type message type of the response packet
273273
/// @param start_event_label label of the start event
274-
/// @param end_event_label label of the end event
274+
/// @param stop_event_label label of the end event
275275
/// @param subnet_id id of the selected subnet
276276
/// @param interval_duration the interval duration
277277
MonitoredDuration(uint16_t family, uint8_t query_type, uint8_t response_type,
278-
const std::string& start_event_label, const std::string& end_event_label,
278+
const std::string& start_event_label, const std::string& stop_event_label,
279279
dhcp::SubnetID subnet_id, const Duration& interval_duration);
280280

281281
/// @brief Constructor

Diff for: src/hooks/dhcp/perfmon/tests/alarm_unittests.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ TEST(Alarm, validConstructors) {
3838
EXPECT_EQ(alarm->getQueryType(), DHCPDISCOVER);
3939
EXPECT_EQ(alarm->getResponseType(), DHCPOFFER);
4040
EXPECT_EQ(alarm->getStartEventLabel(), "process_started");
41-
EXPECT_EQ(alarm->getEndEventLabel(), "process_completed");
41+
EXPECT_EQ(alarm->getStopEventLabel(), "process_completed");
4242
EXPECT_EQ(alarm->getSubnetId(), SUBNET_ID_GLOBAL);
4343
EXPECT_EQ("DHCPDISCOVER-DHCPOFFER.process_started-process_completed.0", alarm->getLabel());
4444
EXPECT_EQ(alarm->getSubnetId(), SUBNET_ID_GLOBAL);
@@ -60,7 +60,7 @@ TEST(Alarm, validConstructors) {
6060
EXPECT_EQ(alarm->getQueryType(), DHCPV6_SOLICIT);
6161
EXPECT_EQ(alarm->getResponseType(), DHCPV6_ADVERTISE);
6262
EXPECT_EQ(alarm->getStartEventLabel(), "mt_queued");
63-
EXPECT_EQ(alarm->getEndEventLabel(), "process_started");
63+
EXPECT_EQ(alarm->getStopEventLabel(), "process_started");
6464
EXPECT_EQ(alarm->getSubnetId(), 77);
6565
EXPECT_EQ("SOLICIT-ADVERTISE.mt_queued-process_started.77", alarm->getLabel());
6666
EXPECT_EQ(alarm->getLowWater(), low_water);

Diff for: src/hooks/dhcp/perfmon/tests/monitored_duration_unittests.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ TEST(DurationKey, basics) {
9393
EXPECT_EQ(key->getQueryType(), DHCPDISCOVER);
9494
EXPECT_EQ(key->getResponseType(), DHCPOFFER);
9595
EXPECT_EQ(key->getStartEventLabel(), "process_started");
96-
EXPECT_EQ(key->getEndEventLabel(), "process_completed");
96+
EXPECT_EQ(key->getStopEventLabel(), "process_completed");
9797
EXPECT_EQ(key->getSubnetId(), SUBNET_ID_GLOBAL);
9898
EXPECT_EQ("DHCPDISCOVER-DHCPOFFER.process_started-process_completed.0", key->getLabel());
9999

@@ -105,7 +105,7 @@ TEST(DurationKey, basics) {
105105
EXPECT_EQ(key->getQueryType(), DHCPV6_SOLICIT);
106106
EXPECT_EQ(key->getResponseType(), DHCPV6_ADVERTISE);
107107
EXPECT_EQ(key->getStartEventLabel(), "mt_queued");
108-
EXPECT_EQ(key->getEndEventLabel(), "process_started");
108+
EXPECT_EQ(key->getStopEventLabel(), "process_started");
109109
EXPECT_EQ(key->getSubnetId(), 77);
110110
EXPECT_EQ("SOLICIT-ADVERTISE.mt_queued-process_started.77", key->getLabel());
111111

@@ -263,7 +263,7 @@ TEST(MonitoredDuration, validConstructors) {
263263
EXPECT_EQ(mond->getQueryType(), DHCPDISCOVER);
264264
EXPECT_EQ(mond->getResponseType(), DHCPOFFER);
265265
EXPECT_EQ(mond->getStartEventLabel(), "process_started");
266-
EXPECT_EQ(mond->getEndEventLabel(), "process_completed");
266+
EXPECT_EQ(mond->getStopEventLabel(), "process_completed");
267267
EXPECT_EQ(mond->getSubnetId(), SUBNET_ID_GLOBAL);
268268
EXPECT_EQ("DHCPDISCOVER-DHCPOFFER.process_started-process_completed.0", mond->getLabel());
269269
EXPECT_EQ(mond->getIntervalDuration(), interval_duration);
@@ -281,7 +281,7 @@ TEST(MonitoredDuration, validConstructors) {
281281
EXPECT_EQ(mond->getQueryType(), DHCPV6_SOLICIT);
282282
EXPECT_EQ(mond->getResponseType(), DHCPV6_ADVERTISE);
283283
EXPECT_EQ(mond->getStartEventLabel(), "mt_queued");
284-
EXPECT_EQ(mond->getEndEventLabel(), "process_started");
284+
EXPECT_EQ(mond->getStopEventLabel(), "process_started");
285285
EXPECT_EQ(mond->getSubnetId(), 77);
286286
EXPECT_EQ("SOLICIT-ADVERTISE.mt_queued-process_started.77", mond->getLabel());
287287
EXPECT_EQ(mond->getIntervalDuration(), interval_duration);

0 commit comments

Comments
 (0)