UNPKG

@joergmittaglawo/dmvconfig

Version:

DMV Configuration scripts for Lawo V__matrix Distributed Multiviewers.

54 lines (53 loc) 2.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PortStatistics = exports.CounterAsArrayRow = exports.Counter = exports.lower = exports.lift = void 0; const VScript = require("vscript"); exports.lift = { PortStatistics: (kwl, socket) => kwl ? (new PortStatistics(new VScript.Subtree(socket, kwl))) : null, Counter: (kwl, socket) => kwl ? (new Counter(new VScript.Subtree(socket, kwl))) : null }; exports.lower = { PortStatistics: (ref) => ref ? ref.raw.kwl : null, Counter: (ref) => ref ? ref.raw.kwl : null }; class Counter { constructor(raw) { this.raw = raw; } get bytes_total() { return new VScript.rKeyword(this, "bytes_total"); } get packets_total() { return new VScript.rKeyword(this, "packets_total"); } get bytes_per_sec() { return new VScript.rKeyword(this, "bytes_per_sec"); } get packets_per_sec() { return new VScript.rKeyword(this, "packets_per_sec"); } } exports.Counter = Counter; class CounterAsArrayRow extends Counter { constructor(st, index, parent) { super(st); this.index = index; this.parent = parent; } } exports.CounterAsArrayRow = CounterAsArrayRow; class PortStatistics { constructor(raw) { this.raw = raw; } get tx_cpu() { return new Counter(this.raw.find("tx_cpu")); } get rx_unicast() { return new Counter(this.raw.find("rx_unicast")); } get rx_broadcast() { return new Counter(this.raw.find("rx_broadcast")); } get rx_multicast() { return new Counter(this.raw.find("rx_multicast")); } get rx_crc_error() { return new Counter(this.raw.find("rx_crc_error")); } get rx_wrong_vlan() { return new Counter(this.raw.find("rx_wrong_vlan")); } get rx_error() { return new Counter(this.raw.find("rx_error")); } get rx_too_long() { return new Counter(this.raw.find("rx_too_long")); } get rx_too_short() { return new Counter(this.raw.find("rx_too_short")); } } exports.PortStatistics = PortStatistics;