Skip to content

Commit

Permalink
dist/lib
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitpubnub committed Feb 5, 2024
1 parent 528fab0 commit f3cab86
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
16 changes: 12 additions & 4 deletions dist/web/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -2534,6 +2534,9 @@
PNAccessManagerAudit: 'PNAccessManagerAudit',
PNAccessManagerRevokeToken: 'PNAccessManagerRevokeToken',
//
// subscription utilities
PNHandshakeOperation: 'PNHandshakeOperation',
PNReceiveMessagesOperation: 'PNReceiveMessagesOperation',
};

/* */
Expand All @@ -2542,6 +2545,11 @@
this._maximumSamplesCount = 100;
this._trackedLatencies = {};
this._latencies = {};
this._telemetryExcludeOperations = [
OPERATIONS.PNSubscribeOperation,
OPERATIONS.PNReceiveMessagesOperation,
OPERATIONS.PNHandshakeOperation,
];
this._maximumSamplesCount = configuration.maximumSamplesCount || this._maximumSamplesCount;
}
/**
Expand All @@ -2562,13 +2570,13 @@
return latencies;
};
default_1.prototype.startLatencyMeasure = function (operationType, identifier) {
if (operationType === OPERATIONS.PNSubscribeOperation || !identifier) {
if (this._telemetryExcludeOperations.includes(operationType) || !identifier) {
return;
}
this._trackedLatencies[identifier] = Date.now();
};
default_1.prototype.stopLatencyMeasure = function (operationType, identifier) {
if (operationType === OPERATIONS.PNSubscribeOperation || !identifier) {
if (this._telemetryExcludeOperations.includes(operationType) || !identifier) {
return;
}
var endpointName = this._endpointName(operationType);
Expand Down Expand Up @@ -6720,7 +6728,7 @@
});

var endpoint$1 = {
getOperation: function () { return OPERATIONS.PNSubscribeOperation; },
getOperation: function () { return OPERATIONS.PNHandshakeOperation; },
validateParams: function (_, params) {
if (!(params === null || params === void 0 ? void 0 : params.channels) && !(params === null || params === void 0 ? void 0 : params.channelGroups)) {
return 'channels and channleGroups both should not be empty';
Expand Down Expand Up @@ -6759,7 +6767,7 @@
};

var endpoint = {
getOperation: function () { return OPERATIONS.PNSubscribeOperation; },
getOperation: function () { return OPERATIONS.PNReceiveMessagesOperation; },
validateParams: function (_, params) {
if (!(params === null || params === void 0 ? void 0 : params.channels) && !(params === null || params === void 0 ? void 0 : params.channelGroups)) {
return 'channels and channleGroups both should not be empty';
Expand Down
2 changes: 1 addition & 1 deletion dist/web/pubnub.min.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions lib/core/components/telemetry_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ var default_1 = /** @class */ (function () {
this._maximumSamplesCount = 100;
this._trackedLatencies = {};
this._latencies = {};
this._telemetryExcludeOperations = [
operations_1.default.PNSubscribeOperation,
operations_1.default.PNReceiveMessagesOperation,
operations_1.default.PNHandshakeOperation,
];
this._maximumSamplesCount = configuration.maximumSamplesCount || this._maximumSamplesCount;
}
/**
Expand All @@ -30,13 +35,13 @@ var default_1 = /** @class */ (function () {
return latencies;
};
default_1.prototype.startLatencyMeasure = function (operationType, identifier) {
if (operationType === operations_1.default.PNSubscribeOperation || !identifier) {
if (this._telemetryExcludeOperations.includes(operationType) || !identifier) {
return;
}
this._trackedLatencies[identifier] = Date.now();
};
default_1.prototype.stopLatencyMeasure = function (operationType, identifier) {
if (operationType === operations_1.default.PNSubscribeOperation || !identifier) {
if (this._telemetryExcludeOperations.includes(operationType) || !identifier) {
return;
}
var endpointName = this._endpointName(operationType);
Expand Down
3 changes: 3 additions & 0 deletions lib/core/constants/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@ exports.default = {
PNAccessManagerAudit: 'PNAccessManagerAudit',
PNAccessManagerRevokeToken: 'PNAccessManagerRevokeToken',
//
// subscription utilities
PNHandshakeOperation: 'PNHandshakeOperation',
PNReceiveMessagesOperation: 'PNReceiveMessagesOperation',
};
2 changes: 1 addition & 1 deletion lib/core/endpoints/subscriptionUtils/handshake.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
var endpoint = {
getOperation: function () { return operations_1.default.PNSubscribeOperation; },
getOperation: function () { return operations_1.default.PNHandshakeOperation; },
validateParams: function (_, params) {
if (!(params === null || params === void 0 ? void 0 : params.channels) && !(params === null || params === void 0 ? void 0 : params.channelGroups)) {
return 'channels and channleGroups both should not be empty';
Expand Down
2 changes: 1 addition & 1 deletion lib/core/endpoints/subscriptionUtils/receiveMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
var operations_1 = __importDefault(require("../../constants/operations"));
var utils_1 = __importDefault(require("../../utils"));
var endpoint = {
getOperation: function () { return operations_1.default.PNSubscribeOperation; },
getOperation: function () { return operations_1.default.PNReceiveMessagesOperation; },
validateParams: function (_, params) {
if (!(params === null || params === void 0 ? void 0 : params.channels) && !(params === null || params === void 0 ? void 0 : params.channelGroups)) {
return 'channels and channleGroups both should not be empty';
Expand Down

0 comments on commit f3cab86

Please sign in to comment.