Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 Change all octothorpes # to _ since private # is only >=ES2022 by matux · Pull Request #1319 · rollbar/rollbar.js · GitHub
Nothing Special   »   [go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions src/browser/replay/recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import hrtime from '../../tracing/hrtime.js';
import logger from '../logger.js';

export default class Recorder {
#options;
#rrwebOptions;
#stopFn = null;
#recordFn;
#events = {
_options;
_rrwebOptions;
_stopFn = null;
_recordFn;
_events = {
previous: [],
current: [],
};
Expand All @@ -26,15 +26,15 @@ export default class Recorder {
}

this.options = options;
this.#recordFn = recordFn;
this._recordFn = recordFn;
}

get isRecording() {
return this.#stopFn !== null;
return this._stopFn !== null;
}

get options() {
return this.#options;
return this._options;
}

set options(newOptions) {
Expand All @@ -57,8 +57,8 @@ export default class Recorder {
// rrweb options
...rrwebOptions
} = newOptions;
this.#options = { enabled, autoStart, maxSeconds, triggers, debug };
this.#rrwebOptions = rrwebOptions;
this._options = { enabled, autoStart, maxSeconds, triggers, debug };
this._rrwebOptions = rrwebOptions;

if (this.isRecording && newOptions.enabled === false) {
this.stop();
Expand All @@ -83,7 +83,7 @@ export default class Recorder {
* @returns {Object|null} A formatted payload containing spans data in OTLP format, or null if no events exist
*/
dump(tracing, replayId, occurrenceUuid) {
const events = this.#events.previous.concat(this.#events.current);
const events = this._events.previous.concat(this._events.current);

if (events.length < 2) {
logger.error('Replay recording cannot have less than 2 events');
Expand Down Expand Up @@ -132,18 +132,18 @@ export default class Recorder {

this.clear();

this.#stopFn = this.#recordFn({
this._stopFn = this._recordFn({
emit: (event, isCheckout) => {
if (this.options.debug?.logEmits) {
this._logEvent(event, isCheckout);
}

if (isCheckout && event.type === EventType.Meta) {
this.#events.previous = this.#events.current;
this.#events.current = [];
this._events.previous = this._events.current;
this._events.current = [];
}

this.#events.current.push(event);
this._events.current.push(event);
},
checkoutEveryNms: this.checkoutEveryNms(),
errorHandler: (error) => {
Expand All @@ -152,7 +152,7 @@ export default class Recorder {
}
return true; // swallow the error instead of throwing it to the window
},
...this.#rrwebOptions,
...this._rrwebOptions,
});

return this;
Expand All @@ -163,14 +163,14 @@ export default class Recorder {
return;
}

this.#stopFn();
this.#stopFn = null;
this._stopFn();
this._stopFn = null;

return this;
}

clear() {
this.#events = {
this._events = {
previous: [],
current: [],
};
Expand Down
50 changes: 25 additions & 25 deletions src/browser/replay/replayManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import logger from '../logger.js';
* are dumped and when they are eventually sent to the backend.
*/
export default class ReplayManager {
#map;
#recorder;
#api;
#tracing;
#telemeter;
_map;
_recorder;
_api;
_tracing;
_telemeter;

/**
* Creates a new ReplayManager instance
Expand All @@ -34,11 +34,11 @@ export default class ReplayManager {
throw new TypeError("Expected 'tracing' to be provided");
}

this.#map = new Map();
this.#recorder = recorder;
this.#api = api;
this.#tracing = tracing;
this.#telemeter = telemeter;
this._map = new Map();
this._recorder = recorder;
this._api = api;
this._tracing = tracing;
this._telemeter = telemeter;
}

/**
Expand All @@ -53,19 +53,19 @@ export default class ReplayManager {
*/
async _processReplay(replayId, occurrenceUuid) {
try {
this.#telemeter?.exportTelemetrySpan({ 'rollbar.replay.id': replayId });
this._telemeter?.exportTelemetrySpan({ 'rollbar.replay.id': replayId });

const payload = this.#recorder.dump(
this.#tracing,
const payload = this._recorder.dump(
this._tracing,
replayId,
occurrenceUuid,
);

this.#map.set(replayId, payload);
this._map.set(replayId, payload);
} catch (transformError) {
logger.error('Error transforming spans:', transformError);

this.#map.set(replayId, null); // TODO(matux): Error span?
this._map.set(replayId, null); // TODO(matux): Error span?
}

return replayId;
Expand Down Expand Up @@ -107,15 +107,15 @@ export default class ReplayManager {
return false;
}

if (!this.#map.has(replayId)) {
if (!this._map.has(replayId)) {
logger.error(
`ReplayManager.send: No replay found for replayId: ${replayId}`,
);
return false;
}

const payload = this.#map.get(replayId);
this.#map.delete(replayId);
const payload = this._map.get(replayId);
this._map.delete(replayId);

// Check if payload is empty (could be raw spans array or OTLP payload)
const isEmpty =
Expand All @@ -131,7 +131,7 @@ export default class ReplayManager {
}

try {
await this.#api.postSpans(payload, { 'X-Rollbar-Replay-Id': replayId });
await this._api.postSpans(payload, { 'X-Rollbar-Replay-Id': replayId });
return true;
} catch (error) {
logger.error('Error sending replay:', error);
Expand All @@ -152,14 +152,14 @@ export default class ReplayManager {
return false;
}

if (!this.#map.has(replayId)) {
if (!this._map.has(replayId)) {
logger.error(
`ReplayManager.discard: No replay found for replayId: ${replayId}`,
);
return false;
}

this.#map.delete(replayId);
this._map.delete(replayId);
return true;
}

Expand All @@ -170,7 +170,7 @@ export default class ReplayManager {
* @returns {Array|null} The spans array or null if not found
*/
getSpans(replayId) {
return this.#map.get(replayId) ?? null;
return this._map.get(replayId) ?? null;
}

/**
Expand All @@ -180,7 +180,7 @@ export default class ReplayManager {
* @param {Array} spans - The spans to set
*/
setSpans(replayId, spans) {
this.#map.set(replayId, spans);
this._map.set(replayId, spans);
}

/**
Expand All @@ -189,13 +189,13 @@ export default class ReplayManager {
* @returns {number} The number of replays currently stored
*/
get size() {
return this.#map.size;
return this._map.size;
}

/**
* Clears all stored replays without sending them
*/
clear() {
this.#map.clear();
this._map.clear();
}
}
20 changes: 10 additions & 10 deletions src/telemetry.js
7FA
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ class Telemeter {
value,
endTimeUnixNano: fromMillis(timestamp),
};
const event = this.#getRepeatedEvent(name, otelAttributes);
const event = this._getRepeatedEvent(name, otelAttributes);
if (event) {
return this.#updateRepeatedEvent(event, otelAttributes, timestamp);
return this._updateRepeatedEvent(event, otelAttributes, timestamp);
}

this.telemetrySpan?.addEvent(
Expand Down Expand Up @@ -312,9 +312,9 @@ class Telemeter {
element,
endTimeUnixNano: fromMillis(timestamp),
};
const event = this.#getRepeatedEvent(name, otelAttributes);
const event = this._getRepeatedEvent(name, otelAttributes);
if (event) {
return this.#updateRepeatedEvent(event, otelAttributes, timestamp);
return this._updateRepeatedEvent(event, otelAttributes, timestamp);
}

this.telemetrySpan?.addEvent(
Expand All @@ -333,15 +333,15 @@ class Telemeter {
);
}

#getRepeatedEvent(name, attributes) {
const lastEvent = this.#lastEvent(this.queue);
_getRepeatedEvent(name, attributes) {
const lastEvent = this._lastEvent(this.queue);

if (lastEvent && lastEvent.body.type === name && lastEvent.otelAttributes.target === attributes.target) {
return lastEvent;
}
}

#updateRepeatedEvent(event, attributes, timestamp) {
_updateRepeatedEvent(event, attributes, timestamp) {
const duration = Math.max(timestamp - event.timestamp_ms, 1);
event.body.value = attributes.value;
event.otelAttributes.value = attributes.value;
Expand All @@ -354,7 +354,7 @@ class Telemeter {
event.otelAttributes.ratio = event.otelAttributes.count / (duration / 1000);
}

#lastEvent(list) {
_lastEvent(list) {
return list.length > 0 ? list[list.length - 1] : null;
}

Expand Down Expand Up @@ -416,9 +416,9 @@ class Telemeter {
textZoomRatio,
};

const event = this.#getRepeatedEvent(name, otelAttributes);
const event = this._getRepeatedEvent(name, otelAttributes);
if (event) {
return this.#updateRepeatedEvent(event, otelAttributes, timestamp);
return this._updateRepeatedEvent(event, otelAttributes, timestamp);
}

this.telemetrySpan?.addEvent(
Expand Down
8 changes: 4 additions & 4 deletions src/tracing/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import id from './id.js';
const SESSION_KEY = 'RollbarSession';

export class Session {
#attributes;
_attributes;

constructor(tracing, options) {
this.options = options;
this.tracing = tracing;
this.window = tracing.window;
this.session = null;
this.#attributes = {};
this._attributes = {};
}

init() {
Expand Down Expand Up @@ -56,11 +56,11 @@ export class Session {
}

get attributes() {
return this.#attributes;
return this._attributes;
}

setAttributes(attributes) {
this.#attributes = { ...this.#attributes, ...attributes };
this._attributes = { ...this._attributes, ...attributes };
return this;
}
}
Loading
0