Skip to content

Commit

Permalink
mongo: swap cx destroy metrics (envoyproxy#13991)
Browse files Browse the repository at this point in the history
Signed-off-by: Bill Chung <bill@mercari.com>
  • Loading branch information
Bill Chung authored and andreyprezotto committed Nov 24, 2020
1 parent ab6e2ff commit ca66519
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Minor Behavior Changes
* jwt_authn filter: added support of Jwt time constraint verification with a clock skew (default to 60 seconds) and added a filter config field :ref:`clock_skew_seconds <envoy_v3_api_field_extensions.filters.http.jwt_authn.v3.JwtProvider.clock_skew_seconds>` to configure it.
* memory: enable new tcmalloc with restartable sequences for aarch64 builds.
* oauth filter: added the optional parameter :ref:`auth_scopes <config_http_filters_oauth>` with default value of 'user' if not provided. Enables for this value to be overridden in the Authorization request to the OAuth provider.
* mongo proxy metrics: swapped network connection remote and local closed counters previously set reversed (`cx_destroy_local_with_active_rq` and `cx_destroy_remote_with_active_rq`).
* tls: removed RSA key transport and SHA-1 cipher suites from the client-side defaults.
* watchdog: the watchdog action :ref:`abort_action <envoy_v3_api_msg_watchdog.v3alpha.AbortActionConfig>` is now the default action to terminate the process if watchdog kill / multikill is enabled.
* xds: to support TTLs, heartbeating has been added to xDS. As a result, responses that contain empty resources without updating the version will no longer be propagated to the
Expand Down
4 changes: 2 additions & 2 deletions source/extensions/filters/network/mongo_proxy/proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ void ProxyFilter::onEvent(Network::ConnectionEvent event) {
}

if (event == Network::ConnectionEvent::RemoteClose && !active_query_list_.empty()) {
stats_.cx_destroy_local_with_active_rq_.inc();
stats_.cx_destroy_remote_with_active_rq_.inc();
}

if (event == Network::ConnectionEvent::LocalClose && !active_query_list_.empty()) {
stats_.cx_destroy_remote_with_active_rq_.inc();
stats_.cx_destroy_local_with_active_rq_.inc();
}
}

Expand Down
8 changes: 4 additions & 4 deletions test/extensions/filters/network/mongo_proxy/proxy_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ TEST_F(MongoProxyFilterTest, ConnectionDestroyLocal) {

EXPECT_CALL(*delay_timer, disableTimer());
read_filter_callbacks_.connection_.raiseEvent(Network::ConnectionEvent::RemoteClose);
EXPECT_EQ(1U, store_.counter("test.cx_destroy_local_with_active_rq").value());
EXPECT_EQ(0U, store_.counter("test.cx_destroy_remote_with_active_rq").value());
EXPECT_EQ(0U, store_.counter("test.cx_destroy_local_with_active_rq").value());
EXPECT_EQ(1U, store_.counter("test.cx_destroy_remote_with_active_rq").value());
}

TEST_F(MongoProxyFilterTest, ConnectionDestroyRemote) {
Expand All @@ -650,8 +650,8 @@ TEST_F(MongoProxyFilterTest, ConnectionDestroyRemote) {

EXPECT_CALL(*delay_timer, disableTimer());
read_filter_callbacks_.connection_.raiseEvent(Network::ConnectionEvent::LocalClose);
EXPECT_EQ(1U, store_.counter("test.cx_destroy_remote_with_active_rq").value());
EXPECT_EQ(0U, store_.counter("test.cx_destroy_local_with_active_rq").value());
EXPECT_EQ(0U, store_.counter("test.cx_destroy_remote_with_active_rq").value());
EXPECT_EQ(1U, store_.counter("test.cx_destroy_local_with_active_rq").value());
}

} // namespace MongoProxy
Expand Down

0 comments on commit ca66519

Please sign in to comment.