Class DevicePortStatsCommand

  • All Implemented Interfaces:
    org.apache.karaf.shell.api.action.Action, CodecContext

    public class DevicePortStatsCommand
    extends AbstractShellCommand
    Lists port statistic of all ports in the system.
    • Constructor Detail

      • DevicePortStatsCommand

        public DevicePortStatsCommand()
    • Method Detail

      • jsonPortStats

        protected com.fasterxml.jackson.databind.JsonNode jsonPortStats​(DeviceService deviceService,
                                                                        Iterable<Device> devices)
        Produces JSON array containing portstats of the specified devices.
        Parameters:
        deviceService - device service
        devices - collection of devices
        Returns:
        JSON Array
      • jsonPortStatsDelta

        protected com.fasterxml.jackson.databind.JsonNode jsonPortStatsDelta​(DeviceService deviceService,
                                                                             Iterable<Device> devices)
        Produces JSON array containing delta portstats of the specified devices.
        Parameters:
        deviceService - device service
        devices - collection of devices
        Returns:
        JSON Array
      • humanReadable

        public static String humanReadable​(long bytes)
        Converts bytes to human readable string with Kilo, Mega, Giga, etc.
        Parameters:
        bytes - input byte array
        Returns:
        human readble string
      • humanReadableBps

        public static String humanReadableBps​(float bps)
        Converts bps to human readable format.
        Parameters:
        bps - input rate
        Returns:
        human readble string