Skip to content

Commit

Permalink
maintenance: record p99 put/multiput/get/multiget rpc byte size (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Tao authored May 6, 2019
1 parent c0341cd commit c9488b7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rdsn
Submodule rdsn updated 35 files
+12 −2 include/dsn/cpp/serialization_helper/dsn.layer2_types.h
+12 −16 include/dsn/dist/replication/replication_types.h
+2 −3 include/dsn/perf_counter/perf_counter.h
+23 −20 include/dsn/perf_counter/perf_counters.h
+3 −11 include/dsn/toollet/profiler.h
+27 −0 src/core/core/dsn.layer2_types.cpp
+28 −28 src/core/perf_counter/perf_counters.cpp
+0 −0 src/core/tests/perf_counter_test.cpp
+9 −8 src/core/tests/perf_counters_test.cpp
+57 −26 src/core/tools/common/profiler.cpp
+11 −11 src/core/tools/common/profiler_command.cpp
+9 −19 src/core/tools/common/profiler_header.h
+4 −4 src/core/tools/common/profiler_output.cpp
+1 −3 src/dist/replication/common/duplication_common.cpp
+23 −24 src/dist/replication/common/replication_types.cpp
+2 −2 src/dist/replication/ddl_lib/replication_ddl_client.cpp
+14 −1 src/dist/replication/lib/replica_stub.cpp
+2 −0 src/dist/replication/lib/replica_stub.h
+5 −1 src/dist/replication/meta_server/CMakeLists.txt
+183 −0 src/dist/replication/meta_server/duplication/duplication_info.cpp
+218 −0 src/dist/replication/meta_server/duplication/duplication_info.h
+172 −0 src/dist/replication/meta_server/duplication/meta_duplication_service.cpp
+96 −0 src/dist/replication/meta_server/duplication/meta_duplication_service.h
+4 −0 src/dist/replication/meta_server/meta_data.h
+51 −10 src/dist/replication/meta_server/meta_service.cpp
+17 −2 src/dist/replication/meta_server/meta_service.h
+5 −2 src/dist/replication/meta_server/server_state.h
+2 −2 src/dist/replication/replication.thrift
+43 −3 src/dist/replication/test/meta_test/misc/misc.h
+4 −1 src/dist/replication/test/meta_test/unit_test/CMakeLists.txt
+7 −0 src/dist/replication/test/meta_test/unit_test/config-test.ini
+0 −17 src/dist/replication/test/meta_test/unit_test/data_definition_test.cpp
+179 −0 src/dist/replication/test/meta_test/unit_test/duplication_info_test.cpp
+83 −43 src/dist/replication/test/meta_test/unit_test/meta_service_test_app.h
+6 −1 src/dsn.layer2.thrift
13 changes: 13 additions & 0 deletions scripts/falcon_screen.json
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,19 @@
"graph_type": "a",
"method": "",
"timespan": 86400
},
{
"title": "各节点 P99 RPC 报文长度",
"endpoints": ["cluster=${cluster.name} job=replica service=pegasus"],
"counters": [
"zion*profiler*RPC_RRDB_RRDB_PUT.size.request.server/cluster=${cluster.name},job=replica,port=${replica.port},service=pegasus",
"zion*profiler*RPC_RRDB_RRDB_MULTI_PUT.size.request.server/cluster=${cluster.name},job=replica,port=${replica.port},service=pegasus",
"zion*profiler*RPC_RRDB_RRDB_GET.size.response.server/cluster=${cluster.name},job=replica,port=${replica.port},service=pegasus",
"zion*profiler*RPC_RRDB_RRDB_MULTI_GET.size.response.server/cluster=${cluster.name},job=replica,port=${replica.port},service=pegasus"
],
"graph_type": "a",
"method": "",
"timespan": 86400
}
]
}
12 changes: 6 additions & 6 deletions src/reporter/pegasus_counter_reporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ void pegasus_counter_reporter::update()
oss << "logging perf counter(name, type, value):" << std::endl;
oss << std::fixed << std::setprecision(2);
perf_counters::instance().iterate_snapshot(
[&oss](const dsn::perf_counter_ptr &ptr, double val) {
oss << "[" << ptr->full_name() << ", " << dsn_counter_type_to_string(ptr->type())
<< ", " << val << "]" << std::endl;
[&oss](const dsn::perf_counters::counter_snapshot &cs) {
oss << "[" << cs.name << ", " << dsn_counter_type_to_string(cs.type) << ", "
<< cs.value << "]" << std::endl;
});
ddebug("%s", oss.str().c_str());
}
Expand All @@ -168,9 +168,9 @@ void pegasus_counter_reporter::update()
bool first_append = true;
_falcon_metric.timestamp = timestamp;
perf_counters::instance().iterate_snapshot(
[&oss, &first_append, this](const dsn::perf_counter_ptr &ptr, double val) {
_falcon_metric.metric = ptr->full_name();
_falcon_metric.value = val;
[&oss, &first_append, this](const dsn::perf_counters::counter_snapshot &cs) {
_falcon_metric.metric = cs.name;
_falcon_metric.value = cs.value;
_falcon_metric.counterType = "GAUGE";
if (!first_append)
oss << ",";
Expand Down
4 changes: 2 additions & 2 deletions src/server/brief_stat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ std::string get_brief_stat()
oss << std::fixed << std::setprecision(0);
bool first_item = true;
dsn::perf_counters::snapshot_iterator iter =
[&oss, &first_item](const dsn::perf_counter_ptr &counter, double value) mutable {
[&oss, &first_item](const dsn::perf_counters::counter_snapshot &cs) mutable {
if (!first_item)
oss << ", ";
oss << s_brief_stat_map.find(counter->full_name())->second << "=" << value;
oss << s_brief_stat_map.find(cs.name)->second << "=" << cs.value;
first_item = false;
};
std::vector<bool> match_result;
Expand Down
4 changes: 4 additions & 0 deletions src/server/config-server.ini
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ profiler::inqueue = false
;profiler::qps = false
profiler::cancelled = false
;profiler::latency.server = false
profiler::size.request.server = true

[task.RPC_RRDB_RRDB_PUT_ACK]
is_profile = true
Expand All @@ -449,6 +450,7 @@ profiler::inqueue = false
;profiler::qps = false
profiler::cancelled = false
;profiler::latency.server = false
profiler::size.request.server = true

[task.RPC_RRDB_RRDB_MULTI_PUT_ACK]
is_profile = true
Expand Down Expand Up @@ -533,6 +535,7 @@ profiler::inqueue = false
;profiler::qps = false
profiler::cancelled = false
;profiler::latency.server = false
profiler::size.response.server = true

[task.RPC_RRDB_RRDB_GET_ACK]
is_profile = true
Expand All @@ -541,6 +544,7 @@ is_profile = true
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
profiler::size.response.server = true

[task.RPC_RRDB_RRDB_SORTKEY_COUNT]
rpc_request_throttling_mode = TM_DELAY
Expand Down
4 changes: 4 additions & 0 deletions src/server/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 50, 50, 50, 50, 50, 100
is_profile = true
profiler::size.request.server = true

[task.RPC_RRDB_RRDB_PUT_ACK]
is_profile = true
Expand All @@ -473,6 +474,7 @@
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 50, 50, 50, 50, 50, 100
is_profile = true
profiler::size.request.server = true

[task.RPC_RRDB_RRDB_MULTI_PUT_ACK]
is_profile = true
Expand Down Expand Up @@ -521,6 +523,7 @@
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 50, 50, 50, 50, 50, 100
is_profile = true
profiler::size.response.server = true

[task.RPC_RRDB_RRDB_GET_ACK]
is_profile = true
Expand All @@ -529,6 +532,7 @@
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 50, 50, 50, 50, 50, 100
is_profile = true
profiler::size.response.server = true

[task.RPC_RRDB_RRDB_MULTI_GET_ACK]
is_profile = true
Expand Down

0 comments on commit c9488b7

Please sign in to comment.