diff src/core/ngx_slab.h @ 6828:99770a5ea14f

Slab: slots statistics. For each slot, the number of total and used entries, as well as the number of allocation requests and failures, are tracked.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 07 Dec 2016 22:25:37 +0300
parents 25ade23cf281
children 6e757036e588
line wrap: on
line diff
--- a/src/core/ngx_slab.h
+++ b/src/core/ngx_slab.h
@@ -23,6 +23,15 @@ struct ngx_slab_page_s {
 
 
 typedef struct {
+    ngx_uint_t        total;
+    ngx_uint_t        used;
+
+    ngx_uint_t        reqs;
+    ngx_uint_t        fails;
+} ngx_slab_stat_t;
+
+
+typedef struct {
     ngx_shmtx_sh_t    lock;
 
     size_t            min_size;
@@ -32,6 +41,8 @@ typedef struct {
     ngx_slab_page_t  *last;
     ngx_slab_page_t   free;
 
+    ngx_slab_stat_t  *stats;
+
     u_char           *start;
     u_char           *end;