File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ defmodule RabbitMQ.MessageDeduplicationPlugin.Cache do
2323
2424 alias :os , as: Os
2525 alias :timer , as: Timer
26+ alias :erlang , as: Erlang
2627 alias :mnesia , as: Mnesia
2728
2829 ## Client API
@@ -153,8 +154,14 @@ defmodule RabbitMQ.MessageDeduplicationPlugin.Cache do
153154
154155 # Return cache information: number of elements and max size
155156 def handle_call ( { :info , cache } , _from , state ) do
156- info = [ size: cache_property ( cache , :limit ) ,
157- entries: Mnesia . table_info ( cache , :size ) ]
157+ info = [
158+ bytes: Mnesia . table_info ( cache , :memory ) * Erlang . system_info ( :wordsize ) ,
159+ entries: Mnesia . table_info ( cache , :size )
160+ ]
161+ info = case cache_property ( cache , :limit ) do
162+ number when is_integer ( number ) -> [ size: number ] ++ info
163+ nil -> info
164+ end
158165
159166 { :reply , info , state }
160167 end
You can’t perform that action at this time.
0 commit comments