Reference·JavaScript · @sascom/jsclientJavaScript

NetworkUsageReporter

Class in @sascom/jsclient.

API catalogue · @sascom/jsclient · Class

TypeScript#
class NetworkUsageReporter

Client-side network accounting. Inert until enable is called — the BIM.works app does that only when the server reports client reporting is switched on.

Members#

Member Kind Description
constructor Method
addBytes Method
disable Method
enable Method
flush Method
isEnabled Method
record Method
recordResourceEntries Method Counts resource timing entries the page's observer cannot see: a Web Worker's requests are in the worker's own timeline, so a worker that fetches posts its e…

constructor#

TypeScript#
constructor(settings?: NetworkUsageSettings)

Parameters#

Name Type Description
settings NetworkUsageSettings

addBytes#

TypeScript#
public addBytes(point: string, direction: "SENT" | "RECEIVED", bytes: number, detail?: string): void

Parameters#

Name Type Description
point string
direction "SENT" | "RECEIVED"
bytes number
detail string

disable#

TypeScript#
public disable(): void

enable#

TypeScript#
public enable(client: Client): void

Parameters#

Name Type Description
client Client

flush#

TypeScript#
public flush(isUnload?: boolean): Promise<void>

Parameters#

Name Type Description
isUnload boolean

isEnabled#

TypeScript#
public isEnabled(): boolean

record#

TypeScript#
public record(point: string, direction: "SENT" | "RECEIVED", bytes: number, durationMs: number, detail?: string): void

Parameters#

Name Type Description
point string
direction "SENT" | "RECEIVED"
bytes number
durationMs number
detail string

recordResourceEntries#

TypeScript#
public recordResourceEntries(entries: (ResourceTimingEntry)[]): void

Counts resource timing entries the page's observer cannot see: a Web Worker's requests are in the worker's own timeline, so a worker that fetches posts its entries for this. Ignored while disabled or with resourceTiming: false.

Parameters#

Name Type Description
entries (ResourceTimingEntry)[]