@@ -315,16 +315,6 @@ class TransportData {
315315 countConnEstablished.init (" Net2.CountConnEstablished" _sr);
316316 countConnClosedWithError.init (" Net2.CountConnClosedWithError" _sr);
317317 countConnClosedWithoutError.init (" Net2.CountConnClosedWithoutError" _sr);
318- countConnIncompatible.init (" Net2.CountConnIncompatible" _sr);
319- countConnIncompatibleWithOldClient.init (" Net2.CountConnIncompatibleWithOldClient" _sr);
320- countConnHandshakeAccepted.init (" Net2.CountConnHandshakeAccepted" _sr);
321- countConnHandshakeRequested.init (" Net2.CountConnHandshakeRequested" _sr);
322- countIncomingConnRequested.init (" Net2.CountIncomingConnRequested" _sr);
323- countIncomingConnAccepted.init (" Net2.CountIncomingConnAccepted" _sr);
324- countOutgoingConnHandshakeComplete.init (" Net2.CountOutgoingConnHandshakeComplete" _sr);
325- countOutgoingConnHandshakeRequested.init (" Net2.CountOutgoingConnHandshakeRequested" _sr);
326- countIncomingConnectionTimedout.init (" Net2.CountIncomingConnectionTimedout" _sr);
327- countIncomingConnConnected.init (" Net2.CountIncomingConnConnected" _sr);
328318 }
329319
330320 Reference<struct Peer > getPeer (NetworkAddress const & address);
@@ -353,16 +343,6 @@ class TransportData {
353343 Int64MetricHandle countConnEstablished;
354344 Int64MetricHandle countConnClosedWithError;
355345 Int64MetricHandle countConnClosedWithoutError;
356- Int64MetricHandle countConnIncompatible;
357- Int64MetricHandle countConnIncompatibleWithOldClient;
358- Int64MetricHandle countConnHandshakeAccepted;
359- Int64MetricHandle countConnHandshakeRequested;
360- Int64MetricHandle countIncomingConnRequested;
361- Int64MetricHandle countIncomingConnAccepted;
362- Int64MetricHandle countOutgoingConnHandshakeComplete;
363- Int64MetricHandle countOutgoingConnHandshakeRequested;
364- Int64MetricHandle countIncomingConnectionTimedout;
365- Int64MetricHandle countIncomingConnConnected;
366346
367347 std::map<NetworkAddress, std::pair<uint64_t , double >> incompatiblePeers;
368348 AsyncTrigger incompatiblePeersChanged;
@@ -839,9 +819,14 @@ ACTOR Future<Void> connectionKeeper(Reference<Peer> self,
839819 when (Reference<IConnection> _conn =
840820 wait (INetworkConnections::net ()->connect (self->destination ))) {
841821 conn = _conn;
842- self->transport ->countOutgoingConnHandshakeRequested ++;
822+ static SimpleCounter<int64_t >* countOutgoingConnectionCreated =
823+ SimpleCounter<int64_t >::makeCounter (" /Transport/TLS/OutgoingConnectionCreated" );
824+ countOutgoingConnectionCreated->increment (1 );
843825 wait (conn->connectHandshake ());
844- self->transport ->countOutgoingConnHandshakeComplete ++;
826+ static SimpleCounter<int64_t >* countOutgoingConnectionHandshakeComplete =
827+ SimpleCounter<int64_t >::makeCounter (
828+ " /Transport/TLS/OutgoingConnectionHandshakeComplete" );
829+ countOutgoingConnectionHandshakeComplete->increment (1 );
845830 self->connectLatencies .addSample (now () - self->lastConnectTime );
846831 if (FlowTransport::isClient ()) {
847832 IFailureMonitor::failureMonitor ().setStatus (self->destination , FailureStatus (false ));
@@ -1527,12 +1512,17 @@ ACTOR static Future<Void> connectionReader(TransportData* transport,
15271512 now () + FLOW_KNOBS->CONNECTION_ID_TIMEOUT ;
15281513 }
15291514 compatible = false ;
1530- transport->countConnIncompatible ++;
1515+ static SimpleCounter<int64_t >* countConnectionIncompatible =
1516+ SimpleCounter<int64_t >::makeCounter (" /Transport/TLS/ConnectionIncompatible" );
1517+ countConnectionIncompatible->increment (1 );
15311518 if (!protocolVersion.hasInexpensiveMultiVersionClient ()) {
15321519 if (peer) {
15331520 peer->protocolVersion ->set (protocolVersion);
15341521 }
1535- transport->countConnIncompatibleWithOldClient ++;
1522+ static SimpleCounter<int64_t >* countConnectionIncompatibleWithVeryOldClient =
1523+ SimpleCounter<int64_t >::makeCounter (
1524+ " /Transport/TLS/ConnectionIncompatibleWithVeryOldClient" );
1525+ countConnectionIncompatibleWithVeryOldClient->increment (1 );
15361526 // Older versions expected us to hang up. It may work even if we don't hang up here, but
15371527 // it's safer to keep the old behavior.
15381528 throw incompatible_protocol_version ();
@@ -1631,9 +1621,10 @@ ACTOR static Future<Void> connectionIncoming(TransportData* self, Reference<ICon
16311621 entry.time = now ();
16321622 entry.addr = conn->getPeerAddress ();
16331623 try {
1634- self->countConnHandshakeRequested ++;
16351624 wait (conn->acceptHandshake ());
1636- self->countConnHandshakeAccepted ++;
1625+ static SimpleCounter<int64_t >* countIncomingConnectionHandshakeAccepted =
1626+ SimpleCounter<int64_t >::makeCounter (" /Transport/TLS/IncomingConnectionHandshakeAccepted" );
1627+ countIncomingConnectionHandshakeAccepted->increment (1 );
16371628 state Promise<Reference<Peer>> onConnected;
16381629 state Future<Void> reader = connectionReader (self, conn, Reference<Peer>(), onConnected);
16391630 if (FLOW_KNOBS->LOG_CONNECTION_ATTEMPTS_ENABLED ) {
@@ -1650,17 +1641,24 @@ ACTOR static Future<Void> connectionIncoming(TransportData* self, Reference<ICon
16501641 }
16511642 when (wait (delayJittered (FLOW_KNOBS->CONNECTION_MONITOR_TIMEOUT ))) {
16521643 CODE_PROBE (true , " Incoming connection timed out" );
1653- self->countIncomingConnectionTimedout ++;
1644+ static SimpleCounter<int64_t >* countIncomingConnectionTimedout =
1645+ SimpleCounter<int64_t >::makeCounter (" /Transport/TLS/IncomingConnectionTimedout" );
1646+ countIncomingConnectionTimedout->increment (1 );
16541647 throw timed_out ();
16551648 }
16561649 }
1657- self->countIncomingConnConnected ++;
1650+ static SimpleCounter<int64_t >* countIncomingConnectionConnected =
1651+ SimpleCounter<int64_t >::makeCounter (" /Transport/TLS/IncomingConnectionConnected" );
1652+ countIncomingConnectionConnected->increment (1 );
16581653 } catch (Error& e) {
16591654 if (e.code () != error_code_actor_cancelled) {
16601655 TraceEvent (" IncomingConnectionError" , conn->getDebugID ())
16611656 .errorUnsuppressed (e)
16621657 .suppressFor (1.0 )
16631658 .detail (" FromAddress" , conn->getPeerAddress ());
1659+ static SimpleCounter<int64_t >* countIncomingConnectionFailed =
1660+ SimpleCounter<int64_t >::makeCounter (" /Transport/TLS/IncomingConnectionFailed" );
1661+ countIncomingConnectionFailed->increment (1 );
16641662 if (FLOW_KNOBS->LOG_CONNECTION_ATTEMPTS_ENABLED ) {
16651663 entry.failed = true ;
16661664 self->connectionHistory .push_back (entry);
@@ -1685,9 +1683,10 @@ ACTOR static Future<Void> listen(TransportData* self, NetworkAddress listenAddr)
16851683 state uint64_t connectionCount = 0 ;
16861684 try {
16871685 loop {
1688- self->countIncomingConnRequested ++;
16891686 Reference<IConnection> conn = wait (listener->accept ());
1690- self->countIncomingConnAccepted ++;
1687+ static SimpleCounter<int64_t >* countIncomingConnectionCreated =
1688+ SimpleCounter<int64_t >::makeCounter (" /Transport/TLS/IncomingConnectionCreated" );
1689+ countIncomingConnectionCreated->increment (1 );
16911690 if (conn) {
16921691 TraceEvent (" ConnectionFrom" , conn->getDebugID ())
16931692 .suppressFor (1.0 )
0 commit comments