dhcpkit.ipv6.server.statistics module

Statistics about the server in shared memory

class dhcpkit.ipv6.server.statistics.ServerStatistics[source]

Bases: object

A set of statistics about the DHCPv6 server

export() → Dict[source]

Export the counters

Returns:The counters in a processable format
get_update_set(interface_name: str = None, bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle = None) → dhcpkit.ipv6.server.statistics.StatisticsSet[source]

Return all statistics objects that need to be updated.

Parameters:
  • interface_name – The name of the interface that we received the packet on
  • bundle – The transaction bundle to base the selection on
Returns:

The set to call count methods on

set_categories(category_settings)[source]

Create space for the given interfaces

Parameters:category_settings – Configuration setting for categories
class dhcpkit.ipv6.server.statistics.Statistics[source]

Bases: object

A set of statistics about DHCPv6

count_do_not_respond()

Call the counting method on all statistics objects

count_for_other_server()

Call the counting method on all statistics objects

count_handling_error()

Call the counting method on all statistics objects

count_incoming_packet()

Call the counting method on all statistics objects

count_malformed_query()

Call the counting method on all statistics objects

count_message_in(key)

Update the counter for the given key

count_message_out(key)

Update the counter for the given key

count_not_allowed()

Call the counting method on all statistics objects

count_other_error()

Call the counting method on all statistics objects

count_outgoing_packet()

Call the counting method on all statistics objects

count_unknown_query_type()

Call the counting method on all statistics objects

count_unparsable_packet()

Call the counting method on all statistics objects

count_use_multicast()

Call the counting method on all statistics objects

export() → Dict[source]

Export the counters

Returns:The counters in a processable format
class dhcpkit.ipv6.server.statistics.StatisticsSet(statistics_set: Iterable = None)[source]

Bases: object

A set of statistics objects that are updated together. The metaclass will create all methods for us.

count_do_not_respond()

Call the counting method on all statistics objects

count_for_other_server()

Call the counting method on all statistics objects

count_handling_error()

Call the counting method on all statistics objects

count_incoming_packet()

Call the counting method on all statistics objects

count_malformed_query()

Call the counting method on all statistics objects

count_message_in(key)

Call the counting method on all statistics objects

count_message_out(key)

Call the counting method on all statistics objects

count_not_allowed()

Call the counting method on all statistics objects

count_other_error()

Call the counting method on all statistics objects

count_outgoing_packet()

Call the counting method on all statistics objects

count_unknown_query_type()

Call the counting method on all statistics objects

count_unparsable_packet()

Call the counting method on all statistics objects

count_use_multicast()

Call the counting method on all statistics objects

dhcpkit.ipv6.server.statistics.create_count_dict_method(method_name: str)[source]

Create a counting method for the StatisticsSet class

Parameters:method_name – The name of the method to call on Statistics objects
Returns:The generated method
dhcpkit.ipv6.server.statistics.create_count_method(method_name: str)[source]

Create a counting method for the StatisticsSet class

Parameters:method_name – The name of the method to call on Statistics objects
Returns:The generated method
dhcpkit.ipv6.server.statistics.create_update_dict_method(counter_name)[source]

Create a counting method for a counter in a dictionary on the Statistics class

Parameters:counter_name – The name of the counter to update
Returns:The generated method
dhcpkit.ipv6.server.statistics.create_update_method(counter_name)[source]

Create a counting method for a simple counter on the Statistics class

Parameters:counter_name – The name of the counter to update
Returns:The generated method