Skip to content

Commit

Permalink
Upgrade metrics and http2comm library
Browse files Browse the repository at this point in the history
Upgrade to v1.1.0 (metrics) and v2.1.4 (http2comm) which
refactor metrics.
Also family unregistered bug is fixed [0].

[0] #102
  • Loading branch information
testillano authored and Eduardo Ramos Testillano (eramedu) committed Aug 6, 2023
1 parent fc5c472 commit 38821a3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ ert_logger_ver=v1.1.0
ert_queuedispatcher_ver=v1.0.3
jupp0r_prometheuscpp_ver=v0.13.0
civetweb_civetweb_ver=v1.14
ert_metrics_ver=v1.0.3
ert_http2comm_ver=v2.1.3
ert_metrics_ver=v1.1.0
ert_http2comm_ver=v2.1.4
nlohmann_json_ver=$(grep ^nlohmann_json_ver__dflt= ${REPO_DIR}/build.sh | cut -d= -f2)
pboettch_jsonschemavalidator_ver=$(grep ^pboettch_jsonschemavalidator_ver__dflt= ${REPO_DIR}/build.sh | cut -d= -f2)
google_test_ver=$(grep ^google_test_ver__dflt= ${REPO_DIR}/build.sh | cut -d= -f2)
Expand Down
4 changes: 2 additions & 2 deletions src/http2/MyTrafficHttp2Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ void MyTrafficHttp2Client::enableMyMetrics(ert::metrics::Metrics *metrics) {
metrics_ = metrics;

if (metrics_) {
ert::metrics::counter_family_ref_t cf = metrics->addCounterFamily(std::string("ServerData_observed_requests_total"), "Http2 total requests observed in h2agent client");
ert::metrics::counter_family_t& cf = metrics->addCounterFamily(std::string("ServerData_observed_requests_total"), "Http2 total requests observed in h2agent client");

observed_requests_processed_counter_ = &(cf.Add({{"result", "processed"}}));
observed_requests_failed_counter_ = &(cf.Add({{"result", "failed"}})); // broken connection

ert::metrics::counter_family_ref_t cf2 = metrics->addCounterFamily(std::string("ServerData_observed_responses_total"), "Http2 total responses observed in h2agent client");
ert::metrics::counter_family_t& cf2 = metrics->addCounterFamily(std::string("ServerData_observed_responses_total"), "Http2 total responses observed in h2agent client");

observed_responses_processed_counter_ = &(cf2.Add({{"result", "successful"}}));
observed_responses_timeout_counter_ = &(cf2.Add({{"result", "timeout"}}));
Expand Down
4 changes: 2 additions & 2 deletions src/http2/MyTrafficHttp2Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ void MyTrafficHttp2Server::enableMyMetrics(ert::metrics::Metrics *metrics) {
metrics_ = metrics;

if (metrics_) {
ert::metrics::counter_family_ref_t cf = metrics->addCounterFamily(std::string("ServerData_observed_requests_total"), "Http2 total requests observed in h2agent server");
ert::metrics::counter_family_t& cf = metrics->addCounterFamily(std::string("ServerData_observed_requests_total"), "Http2 total requests observed in h2agent server");

observed_requests_processed_counter_ = &(cf.Add({{"result", "processed"}}));
observed_requests_unprovisioned_counter_ = &(cf.Add({{"result", "unprovisioned"}}));

ert::metrics::counter_family_ref_t cf2 = metrics->addCounterFamily(std::string("ServerData_purged_contexts_total"), "Total contexts purged in h2agent server");
ert::metrics::counter_family_t& cf2 = metrics->addCounterFamily(std::string("ServerData_purged_contexts_total"), "Total contexts purged in h2agent server");

purged_contexts_successful_counter_ = &(cf2.Add({{"result", "successful"}}));
purged_contexts_failed_counter_ = &(cf2.Add({{"result", "failed"}}));
Expand Down
2 changes: 1 addition & 1 deletion src/model/FileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void FileManager::enableMetrics(ert::metrics::Metrics *metrics) {
metrics_ = metrics;

if (metrics_) {
ert::metrics::counter_family_ref_t cf = metrics->addCounterFamily("FileSystem_observed_operations_total", "H2agent file system operations");
ert::metrics::counter_family_t& cf = metrics->addCounterFamily("FileSystem_observed_operations_total", "H2agent file system operations");
observed_open_operation_counter_ = &(cf.Add({{"operation", "open"}}));
observed_close_operation_counter_ = &(cf.Add({{"operation", "close"}}));
observed_write_operation_counter_ = &(cf.Add({{"operation", "write"}}));
Expand Down
2 changes: 1 addition & 1 deletion src/model/SocketManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void SocketManager::enableMetrics(ert::metrics::Metrics *metrics) {
metrics_ = metrics;

if (metrics_) {
ert::metrics::counter_family_ref_t cf = metrics->addCounterFamily("UDPSocket_observed_operations_total", "H2agent udp socket operations");
ert::metrics::counter_family_t& cf = metrics->addCounterFamily("UDPSocket_observed_operations_total", "H2agent udp socket operations");
observed_open_operation_counter_ = &(cf.Add({{"operation", "open"}}));
observed_write_operation_counter_ = &(cf.Add({{"operation", "write"}}));
observed_delayed_write_operation_counter_ = &(cf.Add({{"operation", "delayedWrite"}}));
Expand Down

0 comments on commit 38821a3

Please sign in to comment.