UNPKG

@microsoft/dev-tunnels-ssh

Version:
43 lines 1.25 kB
"use strict"; // // Copyright (c) Microsoft Corporation. All rights reserved. // Object.defineProperty(exports, "__esModule", { value: true }); exports.ChannelMetrics = void 0; /** * Collects cumulative measurements about a channel. */ class ChannelMetrics { /* @internal */ constructor() { this.bytesSentSum = 0; this.bytesReceivedSum = 0; } /** * Gets the total cumulative number of bytes sent for the duration of the channel, * not including message framing, padding, and MAC bytes. */ get bytesSent() { return this.bytesSentSum; } /** * Gets the total cumulative number of bytes received for the duration of the channel, * not including message framing, padding, and MAC bytes. */ get bytesReceived() { return this.bytesReceivedSum; } /* @internal */ addBytesSent(count) { this.bytesSentSum += count; } /* @internal */ addBytesReceived(count) { this.bytesReceivedSum += count; } toString() { return `Bytes S/R: ${this.bytesSent} / ${this.bytesReceived}; `; } } exports.ChannelMetrics = ChannelMetrics; //# sourceMappingURL=channelMetrics.js.map