Commit 50c6b204 authored by Yoshitaka Aharen's avatar Yoshitaka Aharen
Browse files

[2157] renamed according to coding style, moved to anonymous namespace

parent 5abc52b3
......@@ -35,7 +35,7 @@ def need_generate(filepath, mtime):
the file already exists and newer than the base file.
'''
if os.path.exists(filepath) and\
(os.path.getmtime(filepath) > mtime or
(os.path.getmtime(filepath) > mtime and
os.path.getmtime(filepath) > os.path.getmtime(filepath+pre_suffix)):
return False
return True
......@@ -190,7 +190,7 @@ def generate_cxx(itemsfile, ccfile, utfile, def_mtime):
msg_counter_types = 'enum MSGCounterType {\n'
item_names = ['// using -1 as counter_id to state it is not a '
+ 'counter item\n']
item_names += ['const int NOT_ITEM = -1;\n']
item_names += ['const int NOT_ITEM = -1;\n', '\n']
def convert_list(items, msg_counter_types, item_names_current, item_names):
for item in items:
......@@ -215,7 +215,7 @@ def generate_cxx(itemsfile, ccfile, utfile, def_mtime):
msg_counter_types, item_names_current, item_names = \
convert_list(item_list, msg_counter_types, [], item_names)
item_names.append('const struct CounterTypeTree MSGCounterTree[] = {\n')
item_names.append('const struct CounterTypeTree msg_counter_tree[] = {\n')
item_names.extend(item_names_current)
item_names.append(' { NULL, NULL, NOT_ITEM }\n' +
'};\n')
......
......@@ -38,6 +38,7 @@
using namespace isc::dns;
using namespace isc::auth;
using namespace isc::statistics;
using namespace isc::auth::statistics;
namespace {
......@@ -63,14 +64,14 @@ fillNodes(const Counter& counter,
}
}
// ### STATISTICS ITEMS DEFINITION ###
} // anonymous namespace
namespace isc {
namespace auth {
namespace statistics {
// ### STATISTICS ITEMS DEFINITION ###
// Note: opcode in this array must be start with 0 and be sequential
const int opcode_to_msgcounter[] = {
MSG_OPCODE_QUERY, // Opcode = 0: Query
......@@ -255,7 +256,7 @@ Counters::get() const {
item_tree->set("zones", zones);
Counters::ItemTreePtr server = Element::createMap();
fillNodes(server_msg_counter_, MSGCounterTree, server);
fillNodes(server_msg_counter_, msg_counter_tree, server);
zones->set("_SERVER_", server);
return (item_tree);
......
request MSGCounterRequest Request statistics =
request msg_counter_request Request statistics =
v4 MSG_REQUEST_IPV4 Number of IPv4 requests received by the b10-auth server.
v6 MSG_REQUEST_IPV6 Number of IPv6 requests received by the b10-auth server.
edns0 MSG_REQUEST_EDNS0 Number of requests with EDNS0 received by the b10-auth server.
......@@ -10,7 +10,7 @@ request MSGCounterRequest Request statistics =
tcp MSG_REQUEST_TCP Number of UDP requests received by the b10-auth server.
dnssec_ok MSG_REQUEST_DNSSEC_OK Number of requests with "DNSSEC OK" (DO) bit was set received by the b10-auth server.
;
opcode MSGCounterOpcode Opcode statistics =
opcode msg_counter_opcode Opcode statistics =
query MSG_OPCODE_QUERY Number of Opcode=QUERY requests received by the b10-auth server.
iquery MSG_OPCODE_IQUERY Number of Opcode=IQUERY requests received by the b10-auth server.
status MSG_OPCODE_STATUS Number of Opcode=STATUS requests received by the b10-auth server.
......@@ -19,7 +19,7 @@ opcode MSGCounterOpcode Opcode statistics =
other MSG_OPCODE_OTHER Number of requests in other OpCode received by the b10-auth server.
;
responses MSG_RESPONSE Number of responses sent by the b10-auth server.
response MSGCounterResponse Response statistics =
response msg_counter_response Response statistics =
truncated MSG_RESPONSE_TRUNCATED Number of truncated responses sent by the b10-auth server.
edns0 MSG_RESPONSE_EDNS0 Number of responses with EDNS0 sent by the b10-auth server.
tsig MSG_RESPONSE_TSIG Number of responses with TSIG sent by the b10-auth server.
......@@ -31,7 +31,7 @@ qrynoauthans MSG_QRYNOAUTHANS Number of queries received by the b10-auth server
qryreferral MSG_QRYREFERRAL Number of queries received by the b10-auth server resulted in referral answer.
qrynxrrset MSG_QRYNXRRSET Number of queries received by the b10-auth server resulted in NOERROR but the number of answer RR == 0.
authqryrej MSG_QRYREJECT Number of authoritative queries rejected by the b10-auth server.
rcode MSGCounterRcode Rcode statistics =
rcode msg_counter_rcode Rcode statistics =
noerror MSG_RCODE_NOERROR Number of requests received by the b10-auth server resulted in RCODE = 0 (NoError).
formerr MSG_RCODE_FORMERR Number of requests received by the b10-auth server resulted in RCODE = 1 (FormErr).
servfail MSG_RCODE_SERVFAIL Number of requests received by the b10-auth server resulted in RCODE = 2 (ServFail).
......
......@@ -148,7 +148,7 @@ countTreeElements(const struct CounterTypeTree* tree) {
}
TEST(StatisticsItemsTest, MSGItemNamesCheck) {
EXPECT_EQ(MSG_COUNTER_TYPES, countTreeElements(MSGCounterTree));
EXPECT_EQ(MSG_COUNTER_TYPES, countTreeElements(msg_counter_tree));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment