132132
133133-type state () :: # state {}.
134134-type wal_conf () :: #{name := atom (), % % the name to register the wal as
135+ system := atom (),
135136 names := ra_system :names (),
136137 dir := file :filename_all (),
137138 max_size_bytes => non_neg_integer (),
@@ -254,7 +255,7 @@ start_link(#{name := Name} = Config)
254255-spec init (wal_conf ()) ->
255256 {ok , state ()} |
256257 {stop , wal_checksum_validation_failure } | {stop , term ()}.
257- init (#{dir := Dir } = Conf0 ) ->
258+ init (#{dir := Dir , system : = System } = Conf0 ) ->
258259 #{max_size_bytes := MaxWalSize ,
259260 max_entries := MaxEntries ,
260261 recovery_chunk_size := RecoveryChunkSize ,
@@ -278,7 +279,9 @@ init(#{dir := Dir} = Conf0) ->
278279 process_flag (message_queue_data , off_heap ),
279280 process_flag (min_bin_vheap_size , MinBinVheapSize ),
280281 process_flag (min_heap_size , MinHeapSize ),
281- CRef = ra_counters :new (WalName , ? COUNTER_FIELDS ),
282+ CRef = ra_counters :new (WalName ,
283+ ? COUNTER_FIELDS ,
284+ #{ra_system => System , module => ? MODULE }),
282285 Conf = # conf {dir = Dir ,
283286 segment_writer = SegWriter ,
284287 compute_checksums = ComputeChecksums ,
0 commit comments