Skip to content

Files

Latest commit

1215cfd · Apr 5, 2024

History

History
77 lines (41 loc) · 1.08 KB

faastjs.faastmodule.on.md

File metadata and controls

77 lines (41 loc) · 1.08 KB
id title hide_title
faastjs.faastmodule.on
FaastModule.on() method
true

faastjs > FaastModule > on

FaastModule.on() method

Register a callback for statistics events.

Signature:

on(name: "stats", listener: (statsEvent: FunctionStatsEvent) => void): void;

Parameters

Parameter

Type

Description

name

"stats"

listener

(statsEvent: FunctionStatsEvent) => void

**Returns:**

void

Remarks

The callback is invoked once for each cloud function that was invoked within the last 1s interval, with a FunctionStatsEvent summarizing the statistics for each function. Typical usage:

faastModule.on("stats", console.log);