s3:smbprofile: track connect_count and disconnect_count
authorStefan Metzmacher <metze@samba.org>
Fri, 14 Nov 2014 11:47:01 +0000 (12:47 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 19 Nov 2014 19:51:37 +0000 (20:51 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/smbprofile.h
source3/smbd/process.c
source3/smbd/server_exit.c

index 67ffa77dfd4841f1e331a7c5e5e8769e4332f752..acf80e6543bbd0d946c673180d10ef188073a7b3 100644 (file)
@@ -27,6 +27,8 @@
        SMBPROFILE_STATS_START \
        \
        SMBPROFILE_STATS_SECTION_START("SMBD loop") \
+       SMBPROFILE_STATS_COUNT(connect) \
+       SMBPROFILE_STATS_COUNT(disconnect) \
        SMBPROFILE_STATS_BASIC(idle) \
        SMBPROFILE_STATS_COUNT(request) \
        SMBPROFILE_STATS_BASIC(push_sec_ctx) \
index 2e611e2537ef2b5c0e1183ba482cc96e8c61c0f4..c7f0e9ade9ad2717d27d49b54162440deaf431fe 100644 (file)
@@ -3573,6 +3573,8 @@ NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd,
 
        *_xconn = NULL;
 
+       DO_PROFILE_INC(connect);
+
        xconn = talloc_zero(client, struct smbXsrv_connection);
        if (xconn == NULL) {
                DEBUG(0,("talloc_zero(struct smbXsrv_connection)\n"));
index 6a51c24f549984f0ef7e21160661f49e18cdb762..e5d32b8fe778f9deb644d01c79e2936ee173a056 100644 (file)
@@ -224,6 +224,7 @@ static void exit_server_common(enum server_exit_reason how,
                        next = xconn->next;
                        DLIST_REMOVE(client->connections, xconn);
                        talloc_free(xconn);
+                       DO_PROFILE_INC(disconnect);
                }
                TALLOC_FREE(client->sconn);
        }