@@ -50,8 +50,13 @@ to_json(ReqData, Context) ->
50
50
rabbit_mgmt_format :strip_pids (Q )),
51
51
rabbit_mgmt_util :reply (ensure_defaults (Payload ), ReqData , Context );
52
52
true ->
53
- rabbit_mgmt_util :reply (rabbit_mgmt_format :strip_pids (queue (ReqData )),
54
- ReqData , Context )
53
+ Q = case rabbit_mgmt_util :enable_queue_totals (ReqData ) of
54
+ false -> queue (ReqData );
55
+ true -> queue_with_totals (ReqData )
56
+ end ,
57
+ rabbit_mgmt_util :reply (
58
+ rabbit_mgmt_format :strip_pids (Q ),
59
+ ReqData , Context )
55
60
end
56
61
catch
57
62
{error , invalid_range_parameters , Reason } ->
@@ -110,10 +115,26 @@ queue(ReqData) ->
110
115
VHost -> queue (VHost , rabbit_mgmt_util :id (queue , ReqData ))
111
116
end .
112
117
113
-
114
118
queue (VHost , QName ) ->
115
119
Name = rabbit_misc :r (VHost , queue , QName ),
116
120
case rabbit_amqqueue :lookup (Name ) of
117
121
{ok , Q } -> rabbit_mgmt_format :queue (Q );
118
122
{error , not_found } -> not_found
119
123
end .
124
+
125
+ queue_with_totals (ReqData ) ->
126
+ case rabbit_mgmt_util :vhost (ReqData ) of
127
+ not_found -> not_found ;
128
+ VHost -> queue_with_totals (VHost , rabbit_mgmt_util :id (queue , ReqData ))
129
+ end .
130
+
131
+ queue_with_totals (VHost , QName ) ->
132
+ Name = rabbit_misc :r (VHost , queue , QName ),
133
+ case rabbit_amqqueue :lookup (Name ) of
134
+ {ok , Q } -> QueueInfo = rabbit_amqqueue :info (Q ,
135
+ [name , durable , auto_delete , exclusive ,
136
+ owner_pid , arguments , type , state ,
137
+ policy , totals , online , type_specific ]),
138
+ rabbit_mgmt_format :queue_info (QueueInfo );
139
+ {error , not_found } -> not_found
140
+ end .
0 commit comments