< Home

collect counters top

Function

The collect counters top command sets the parameters for top N interface traffic statistics and enables the function to generate top N interface traffic statistics reports.

Format

collect counters top [ number ] interface { interface-type | all | layer-2 | layer-3 } [ sort-by statistics-type | interval interval-value ] *

Parameters

Parameter Description Value

number

Specifies the number of busiest interfaces for which traffic statistics reports are to be generated.

For example, if the value is 10, a traffic statistics report about top 10 busiest interfaces is generated.

If you do not specify this parameter, a traffic statistics report about top 20 busiest interfaces is generated.

The value is an integer ranging from 1 to 50000.

interface { interface-type | all | layer-2 | layer-3 }

Specifies the type of the interfaces for which a top N traffic statistics report is to be generated:

  • interface-type: indicates a specific type of interface.
  • all: indicates all interfaces.
  • layer-2: indicates Layer 2 interfaces.
  • layer-3: indicates Layer 3 interfaces.

The specified interfaces must be Ethernet physical interfaces or Eth-Trunk interfaces.

sort-by statistics-type

Specifies the statistics type by which ports are determined to be the busiest.

If you do not specify sort-by statistics-type, statistics are sorted by the total number of bytes in descending order.

The value can be:
  • utilization: indicates to sort statistics by bandwidth utilization.
  • bytes: indicates to sort statistics by the total number of bytes.
  • packets: indicates to sort statistics by the total number of packets.
  • multicast: indicates to sort statistics by the total number of multicast packets.
  • broadcast: indicates to sort statistics by the total number of broadcast packets.
  • errors: indicates to sort statistics by the total number of error packets.
  • discards: indicates to sort statistics by the total number of dropped packets.

interval interval-value

Specifies the interval at which statistics are collected.

The value is an integer ranging from 1 to 999, in seconds. The default value is 30.

Views

All views

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The display command allows you to view statistics about the traffic sent and received by each interface on a device, but cannot sort these statistics by traffic volume in descending order. The display counters top interface command allows you to view top N interface traffic statistics reports, facilitating interface monitoring. Before you view a top N interface traffic statistics report, run the collect counters top command to generate your desired top N interface traffic statistics report. For example, configure the device to generate a top N statistics report about packets dropped on Layer 2 interfaces within 50s.

The top N interface traffic statistics function sorts statistics about inbound and outbound traffic processed by interfaces within a collection interval in descending order and generates a top N interface traffic statistics report. The device stops collecting interface traffic statistics after the collection interval ends. To generate another top N interface traffic statistics report, run the collect counters top command again.

Configuration Impact

  • After the collect counters top command is run, the device collects interface traffic statistics and generates a top N interface traffic statistics report based on the set parameters.
  • The collect counters top command configuration is not saved in the configuration file.

Follow-up Procedure

To view a top N interface traffic statistics report, run the display counters top interface command.

Precautions
  • When the master switch in a stack containing multiple member switches is faulty, the top N interface traffic statistics function takes effect only on a master switch. If the master switch encounters a fault and switches to the backup state, run the collect counters top command on the new master switch again.
  • The collect counters top command can be run multiple times in succession with different parameters specified. For example, you can configure a device to generate a top N statistics report about interface multicast packets when the device is still generating a top N statistics report about interface broadcast packets.
  • The top N interface traffic statistics function allows a device to generate a maximum of five top N interface traffic statistics reports. If you want the device to generate new top N interface traffic statistics reports when five top N interface traffic statistics reports already exist, run the reset counters top interface command to clear existing ones.

Example

# Configure a device to generate a statistics report about top 10 Layer 2 interfaces in terms of the number of packets dropped within 40s.
<HUAWEI> collect counters top 10 interface layer-2 sort-by discards interval 40
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >