View Source erldist_filter_nif (erldist_filter v1.1.0)

Link to this section Summary

Link to this section Types

-type action() :: {emit, binary()} | {log, non_neg_integer(), {logger_time(), logger_event()}}.
-type channel() :: erlang:nif_resource().
-type channel_inspection() ::
    #{controlling_process := pid(),
      entry :=
          #{connection_id := connection_id(),
            creation := creation(),
            dflags := distribution_flags(),
            sysname := sysname()},
      rx :=
          #{atom_cache := [{0..2047, atom()}],
            ioq_size := non_neg_integer(),
            packet_size := non_neg_integer(),
            stats := channel_stats(),
            vec_capacity := non_neg_integer(),
            vec_len := non_neg_integer()},
      tracing_process := undefined | pid()}.
-type channel_stats() ::
    #{packet_count := non_neg_integer(),
      emit_count := non_neg_integer(),
      drop_count := non_neg_integer(),
      dist_header_count := non_neg_integer(),
      dist_frag_header_count := non_neg_integer(),
      dist_frag_cont_count := non_neg_integer(),
      dist_pass_through_count := non_neg_integer(),
      atom_cache_read_count := non_neg_integer(),
      atom_cache_write_count := non_neg_integer(),
      atom_cache_overwrite_count := non_neg_integer(),
      rewrite_fragment_header_count := non_neg_integer(),
      rollback_atom_cache_count := non_neg_integer(),
      compact_external_count := non_neg_integer(),
      compact_fragment_count := non_neg_integer(),
      control_has_export_ext := non_neg_integer(),
      control_has_new_fun_ext := non_neg_integer(),
      payload_has_export_ext := non_neg_integer(),
      payload_has_new_fun_ext := non_neg_integer(),
      fastpath := non_neg_integer(),
      slowpath := non_neg_integer(),
      dop_link := dop_stats(),
      dop_send := dop_stats(),
      dop_exit := dop_stats(),
      dop_unlink := dop_stats(),
      dop_reg_send := dop_stats(),
      dop_group_leader := dop_stats(),
      dop_exit2 := dop_stats(),
      dop_send_tt := dop_stats(),
      dop_exit_tt := dop_stats(),
      dop_reg_send_tt := dop_stats(),
      dop_exit2_tt := dop_stats(),
      dop_monitor_p := dop_stats(),
      dop_demonitor_p := dop_stats(),
      dop_monitor_p_exit := dop_stats(),
      dop_send_sender := dop_stats(),
      dop_send_sender_tt := dop_stats(),
      dop_payload_exit := dop_stats(),
      dop_payload_exit_tt := dop_stats(),
      dop_payload_exit2 := dop_stats(),
      dop_payload_exit2_tt := dop_stats(),
      dop_payload_monitor_p_exit := dop_stats(),
      dop_spawn_request := dop_stats(),
      dop_spawn_request_tt := dop_stats(),
      dop_spawn_reply := dop_stats(),
      dop_spawn_reply_tt := dop_stats(),
      dop_alias_send := dop_stats(),
      dop_alias_send_tt := dop_stats(),
      dop_unlink_id := dop_stats(),
      dop_unlink_id_ack := dop_stats()}.
-type connection_id() :: 0..4294967295.
-type creation() :: 0..4294967295.
-type distribution_flags() :: 0..18446744073709551615.
-type dop_stats() :: #{seen := non_neg_integer(), emit := non_neg_integer(), drop := non_neg_integer()}.
-type logger() :: erlang:nif_resource().
-type logger_event_atoms() :: tuple() | eqwalizer:dynamic().
Link to this type

logger_event_control/0

View Source
-type logger_event_control() :: undefined | binary().
Link to this type

logger_event_payload/0

View Source
-type logger_event_payload() :: undefined | binary().
-type logger_inspection() ::
    #{controlling_process := pid(), dropped := non_neg_integer(), received := non_neg_integer()}.
Link to this type

logger_select_handle/0

View Source
-type logger_select_handle() :: reference().
-type logger_time() :: integer().
-type packet_size() :: 0 | 1 | 2 | 4 | 8.
-type router_info() :: #{count := pos_integer(), limit := pos_integer(), names := [atom()]}.
-type sysname() :: node().
Link to this type

world_stat_group_channel/0

View Source
-type world_stat_group_channel() ::
    #{create := non_neg_integer(), destroy := non_neg_integer(), rx_stats := channel_stats()}.
Link to this type

world_stat_group_memory/0

View Source
-type world_stat_group_memory() ::
    #{vec_own_bin_create := non_neg_integer(),
      vec_own_bin_create_capacity := non_neg_integer(),
      vec_own_bin_realloc := non_neg_integer(),
      vec_own_bin_realloc_capacity := non_neg_integer(),
      vec_own_bin_destroy := non_neg_integer(),
      vec_own_mem_create := non_neg_integer(),
      vec_own_mem_create_capacity := non_neg_integer(),
      vec_own_mem_realloc := non_neg_integer(),
      vec_own_mem_realloc_capacity := non_neg_integer(),
      vec_own_mem_destroy := non_neg_integer(),
      vec_ref_bin_create := non_neg_integer(),
      vec_ref_bin_destroy := non_neg_integer(),
      vec_ref_ioq_create := non_neg_integer(),
      vec_ref_ioq_destroy := non_neg_integer()}.
-type world_stats() ::
    #{channel := world_stat_group_channel(),
      memory := world_stat_group_memory(),
      slots := non_neg_integer()}.

Link to this section Functions

-spec atom2cix(Atom) -> CacheIndex when Atom :: atom(), CacheIndex :: integer().
-spec atom_text_inspect(Atom) -> ok when Atom :: atom().
Link to this function

atom_text_put_and_keep(AtomText, AtomEncoding)

View Source
-spec atom_text_put_and_keep(AtomText, AtomEncoding) -> Atom
                          when AtomText :: binary(), AtomEncoding :: latin1 | utf8, Atom :: atom().
-spec atom_text_release(Atom) -> ok when Atom :: atom().
-spec atom_text_table_list() -> [atom()].
-spec atom_text_table_size() -> non_neg_integer().
-spec channel_close(Channel :: channel()) -> ok | {error, closed | not_owner}.
Link to this function

channel_inspect(Channel)

View Source
-spec channel_inspect(Channel :: channel()) -> channel_inspection().
-spec channel_list() -> [channel()].
-spec channel_list(Sysname) -> [channel()] when Sysname :: sysname().
Link to this function

channel_open(PacketSize, Sysname, Creation, ConnectionId, DistributionFlags)

View Source
-spec channel_open(PacketSize, Sysname, Creation, ConnectionId, DistributionFlags) -> Channel
                when
                    PacketSize :: packet_size(),
                    Sysname :: sysname(),
                    Creation :: creation(),
                    ConnectionId :: connection_id(),
                    DistributionFlags :: distribution_flags(),
                    Channel :: channel().
Link to this function

channel_recv(Channel, Input)

View Source
-spec channel_recv(Channel :: channel(), Input :: binary() | erlang:iovec()) -> [action()].
Link to this function

channel_set_controlling_process(Channel, NewOwnerPid)

View Source
-spec channel_set_controlling_process(Channel, NewOwnerPid) -> ok | {error, Reason}
                                   when
                                       Channel :: channel(),
                                       NewOwnerPid :: pid(),
                                       Reason :: closed | not_owner.
Link to this function

channel_set_tracing_process(Channel, NewTracePid)

View Source
-spec channel_set_tracing_process(Channel, NewTracePid) -> ok | {error, Reason}
                               when
                                   Channel :: channel(),
                                   NewTracePid :: pid(),
                                   Reason :: closed | not_owner.
-spec config_get() ->
              #{compact_fragments := boolean(),
                deep_packet_inspection := boolean(),
                logging := boolean(),
                redirect_dist_operations := boolean(),
                untrusted := boolean()}.
-spec config_get(compact_fragments) -> boolean();
          (deep_packet_inspection) -> boolean();
          (logging) -> boolean();
          (redirect_dist_operations) -> boolean();
          (untrusted) -> boolean().
-spec config_set(compact_fragments, boolean()) -> ok;
          (deep_packet_inspection, boolean()) -> ok;
          (logging, boolean()) -> ok;
          (redirect_dist_operations, boolean()) -> ok;
          (untrusted, boolean()) -> ok.
Link to this function

dist_ext_to_term(AtomsTuple, InputBinary)

View Source
-spec dist_ext_to_term(AtomsTuple, InputBinary) -> Term
                    when
                        AtomsTuple :: logger_event_atoms(),
                        InputBinary :: binary(),
                        Term :: eqwalizer:dynamic().
Link to this function

dist_ext_to_vdist(AtomsTuple, InputBinary)

View Source
-spec dist_ext_to_vdist(AtomsTuple, InputBinary) -> VDist
                     when
                         AtomsTuple :: logger_event_atoms(),
                         InputBinary :: binary(),
                         VDist :: vdist:dop_t().
Link to this function

dist_ext_to_vterm(AtomsTuple, InputBinary)

View Source
-spec dist_ext_to_vterm(AtomsTuple, InputBinary) -> VTerm
                     when
                         AtomsTuple :: logger_event_atoms(),
                         InputBinary :: binary(),
                         VTerm :: vterm:t().
Link to this function

dist_ext_to_vterm(AtomsTuple, InputBinary, Limit)

View Source
-spec dist_ext_to_vterm(AtomsTuple, InputBinary, Limit) -> VTerm
                     when
                         AtomsTuple :: logger_event_atoms(),
                         InputBinary :: binary(),
                         Limit :: integer(),
                         VTerm :: vterm:t().
Link to this function

dist_int_to_vdist(AtomsTuple, InputBinary)

View Source
-spec dist_int_to_vdist(AtomsTuple, InputBinary) -> VDist
                     when
                         AtomsTuple :: logger_event_atoms(),
                         InputBinary :: binary(),
                         VDist :: vdist:dop_t().
Link to this function

dist_int_to_vterm(AtomsTuple, InputBinary)

View Source
-spec dist_int_to_vterm(AtomsTuple, InputBinary) -> VTerm
                     when
                         AtomsTuple :: logger_event_atoms(),
                         InputBinary :: binary(),
                         VTerm :: vterm:t().
Link to this function

dist_int_to_vterm(AtomsTuple, InputBinary, Limit)

View Source
-spec dist_int_to_vterm(AtomsTuple, InputBinary, Limit) -> VTerm
                     when
                         AtomsTuple :: logger_event_atoms(),
                         InputBinary :: binary(),
                         Limit :: integer(),
                         VTerm :: vterm:t().
-spec distribution_flags() -> #{atom() => distribution_flags()}.
-spec init() -> ok | Error
        when
            Error :: {error, {Reason, Text :: string()}},
            Reason :: load_failed | bad_lib | load | reload | upgrade | old_code.
-spec internal_hash(Term) -> Hash when Term :: term(), Hash :: integer().
-spec logger_close(Logger) -> ok | {error, Reason} when Logger :: logger(), Reason :: closed | not_owner.
-spec logger_inspect(Logger) -> logger_inspection() | {error, Reason}
                  when Logger :: logger(), Reason :: closed.
-spec logger_list() -> [logger()].
-spec logger_open() -> Logger when Logger :: logger().
-spec logger_recv(Logger) -> Select | Batch | {error, Reason}
               when
                   Logger :: logger(),
                   Select :: {select, logger_select_handle()},
                   Batch :: {Size, Drop, [Element]},
                   Size :: non_neg_integer(),
                   Drop :: non_neg_integer(),
                   Element :: {Time, Event},
                   Time :: logger_time(),
                   Event :: logger_event(),
                   Reason :: closed | not_owner.
Link to this function

logger_set_capacity(NewCapacity)

View Source
-spec logger_set_capacity(NewCapacity) -> OldCapacity
                       when NewCapacity :: non_neg_integer(), OldCapacity :: non_neg_integer().
Link to this function

logger_set_controlling_process(Logger, NewOwnerPid)

View Source
-spec logger_set_controlling_process(Logger, NewOwnerPid) -> ok | {error, Reason}
                                  when
                                      Logger :: logger(),
                                      NewOwnerPid :: pid(),
                                      Reason :: closed | not_owner.
-spec router_info() -> RouterInfo when RouterInfo :: router_info().
-spec router_name(Sysname) -> RouterName when Sysname :: sysname(), RouterName :: atom().
-spec version_build_date() -> non_neg_integer().
-spec world_stats_get() -> world_stats().