Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/sentry_deno/packages/hub/src/index.ts>SessionFlusher

Unofficial port of the Sentry SDK for JavaScript to Deno.
Latest
class SessionFlusher
implements SessionFlusherLike
import { SessionFlusher } from "https://deno.land/x/sentry_deno@v0.2.2/packages/hub/src/index.ts";

Constructors

new
SessionFlusher(client: Client, attrs: ReleaseHealthAttributes)

Properties

private
_client: Client
private
_intervalId: ReturnType<setInterval>
private
_isEnabled: boolean
private
_pendingAggregates: Record<number, AggregationCounts>
private
_sessionAttrs: ReleaseHealthAttributes
readonly
flushTimeout: number

Methods

private
_incrementSessionStatusCount(status: RequestSessionStatus, date: Date): number

Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of the session received

close(): void

JSDoc

flush(): void

Checks if pendingAggregates has entries, and if it does flushes them by calling sendSession

getSessionAggregates(): SessionAggregates

Massages the entries in pendingAggregates and returns aggregated sessions

Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then fetches the session status of the request from Scope.getRequestSession().status on the scope and passes them to _incrementSessionStatusCount along with the start date