]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream: rename {srv,prx}_queue_size to *_queue_pos
authorPatrick Hemmer <haproxy@stormcloud9.net>
Fri, 11 May 2018 16:52:31 +0000 (12:52 -0400)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Aug 2018 13:04:14 +0000 (15:04 +0200)
The current name is misleading as it implies a queue size, but the value
instead indicates a position in the queue.
The value is only the queue size at the exact moment the element is enqueued.
Soon we will gain the ability to insert anywhere into the queue, upon which
clarity of the name is more important.

include/types/stream.h
src/log.c
src/proto_http.c
src/queue.c
src/stream.c

index 0dbc79f446cb3e34062fa9c2607005e9ef601b7c..a3137bf31fb6ebad8d8fb7e27b504289403f2227 100644 (file)
@@ -105,8 +105,8 @@ struct strm_logs {
        long  t_connect;                /* delay before the connect() to the server succeeds, -1 if never occurs */
        long  t_data;                   /* delay before the first data byte from the server ... */
        unsigned long t_close;          /* total stream duration */
-       unsigned long srv_queue_size;   /* number of streams waiting for a connect slot on this server at accept() time (in direct assignment) */
-       unsigned long prx_queue_size;   /* overall number of streams waiting for a connect slot on this instance at accept() time */
+       unsigned long srv_queue_pos;    /* number of streams de-queued while waiting for a connection slot on this server */
+       unsigned long prx_queue_pos;    /* number of streams de-qeuued while waiting for a connection slot on this instance */
        long long bytes_in;             /* number of bytes transferred from the client to the server */
        long long bytes_out;            /* number of bytes transferred from the server to the client */
 };
index e2ced80d89b840bd065a30af0d5311dbb45e0f8c..dcb2ba0697000f3c3681b569ddf2ad8b895d0d78 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -2135,7 +2135,7 @@ int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list
                                break;
 
                        case LOG_FMT_SRVQUEUE: // %sq
-                               ret = ltoa_o(s->logs.srv_queue_size, tmplog, dst + maxsize - tmplog);
+                               ret = ltoa_o(s->logs.srv_queue_pos, tmplog, dst + maxsize - tmplog);
                                if (ret == NULL)
                                        goto out;
                                tmplog = ret;
@@ -2143,7 +2143,7 @@ int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list
                                break;
 
                        case LOG_FMT_BCKQUEUE:  // %bq
-                               ret = ltoa_o(s->logs.prx_queue_size, tmplog, dst + maxsize - tmplog);
+                               ret = ltoa_o(s->logs.prx_queue_pos, tmplog, dst + maxsize - tmplog);
                                if (ret == NULL)
                                        goto out;
                                tmplog = ret;
index 9cbf3eddaa4d0db8c588b6847ae9644af207ae7d..999c39ebfacf2b5908499ffa114cf2c0792b7a20 100644 (file)
@@ -4426,8 +4426,8 @@ void http_end_txn_clean_session(struct stream *s)
        s->logs.t_connect = -1;
        s->logs.t_data = -1;
        s->logs.t_close = 0;
-       s->logs.prx_queue_size = 0;  /* we get the number of pending conns before us */
-       s->logs.srv_queue_size = 0; /* we will get this number soon */
+       s->logs.prx_queue_pos = 0;  /* we get the number of pending conns before us */
+       s->logs.srv_queue_pos = 0; /* we will get this number soon */
 
        s->logs.bytes_in = s->req.total = ci_data(&s->req);
        s->logs.bytes_out = s->res.total = ci_data(&s->res);
index 57fd087bfe10084a6c7d8cda50b3f8a1ed28abf6..aa22256b1188c3054fb003e6ae247a551deaaffc 100644 (file)
@@ -302,14 +302,14 @@ struct pendconn *pendconn_add(struct stream *strm)
 
        if (srv) {
                srv->nbpend++;
-               strm->logs.srv_queue_size += srv->nbpend;
+               strm->logs.srv_queue_pos += srv->nbpend;
                if (srv->nbpend > srv->counters.nbpend_max)
                        srv->counters.nbpend_max = srv->nbpend;
                LIST_ADDQ(&srv->pendconns, &p->list);
        }
        else {
                px->nbpend++;
-               strm->logs.prx_queue_size += px->nbpend;
+               strm->logs.prx_queue_pos += px->nbpend;
                if (px->nbpend > px->be_counters.nbpend_max)
                        px->be_counters.nbpend_max = px->nbpend;
                LIST_ADDQ(&px->pendconns, &p->list);
index aa021b0b3915be29905b0c5f5115228972b1f433..d741a86b9d3296249ab8937b0ac6f2e2b6bac05a 100644 (file)
@@ -125,8 +125,8 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin)
        s->logs.t_data = -1;
        s->logs.t_close = 0;
        s->logs.bytes_in = s->logs.bytes_out = 0;
-       s->logs.prx_queue_size = 0;  /* we get the number of pending conns before us */
-       s->logs.srv_queue_size = 0; /* we will get this number soon */
+       s->logs.prx_queue_pos = 0;  /* we get the number of pending conns before us */
+       s->logs.srv_queue_pos = 0; /* we will get this number soon */
 
        /* default logging function */
        s->do_log = strm_log;