UNPKG

1.53 kBTypeScriptView Raw
1import { SessionAggregates, SessionFlusherLike, Transport } from '@sentry/types';
2declare type ReleaseHealthAttributes = {
3 environment?: string;
4 release: string;
5};
6/**
7 * @inheritdoc
8 */
9export declare class SessionFlusher implements SessionFlusherLike {
10 readonly flushTimeout: number;
11 private _pendingAggregates;
12 private _sessionAttrs;
13 private _intervalId;
14 private _isEnabled;
15 private _transport;
16 constructor(transport: Transport, attrs: ReleaseHealthAttributes);
17 /** Sends session aggregates to Transport */
18 sendSessionAggregates(sessionAggregates: SessionAggregates): void;
19 /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSessions` */
20 flush(): void;
21 /** Massages the entries in `pendingAggregates` and returns aggregated sessions */
22 getSessionAggregates(): SessionAggregates;
23 /** JSDoc */
24 close(): void;
25 /**
26 * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then
27 * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to
28 * `_incrementSessionStatusCount` along with the start date
29 */
30 incrementSessionStatusCount(): void;
31 /**
32 * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of
33 * the session received
34 */
35 private _incrementSessionStatusCount;
36}
37export {};
38//# sourceMappingURL=sessionflusher.d.ts.map
\No newline at end of file