UNPKG

diffusion

Version:

Diffusion JavaScript client

34 lines (33 loc) 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AbstractMetricCollector = void 0; var errors_1 = require("./../../../errors/errors"); /** * @module Services.MetricCollectors */ /** * A session metric collector. */ var AbstractMetricCollector = /** @class */ (function () { /** * Constructor. * * @param name identity * @param exportToPrometheus whether to expose the collector through the Prometheus gateway * @param maximumGroups the maximum number of groups * @throws an {@link IllegalArgumentError} if the name is empty or the maximum number of groups is not positive */ function AbstractMetricCollector(name, exportToPrometheus, maximumGroups) { if ((name === null || name === void 0 ? void 0 : name.length) === 0) { throw new errors_1.IllegalArgumentError('name cannot be empty'); } if (maximumGroups < 1) { throw new errors_1.IllegalArgumentError("maximumGroups must be positive: " + maximumGroups); } this.name = name; this.maximumGroups = maximumGroups; this.exportToPrometheus = exportToPrometheus; } return AbstractMetricCollector; }()); exports.AbstractMetricCollector = AbstractMetricCollector;