FunctionStats class
Summary statistics for function invocations.
Signature:
export declare class FunctionStats
Remarks
localStartLatency remoteStartLatency executionTime
◀──────────────────▶◁ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▷◀──────────▶
┌───────────────────────────────────┬──────────────────────────────────────┐
│ │ │
│ Local │ Cloud Provider │
│ │ │
│ ┌─────────┐ │ ┌──────────┐ ┌──────────┐ │
│ │ │ │ │ │ │ │ │
│ │ local │ │ │ request │ │ │ │
│ invoke ────────▶│ queue │────┼──▶│ queue ├────────▶│ │ │
│ │ │ │ │ │ │ │ │
│ └─────────┘ │ └──────────┘ │ cloud │ │
│ │ │ function │ │
│ ┌─────────┐ │ ┌──────────┐ │ │ │
│ │ │ │ │ │ │ │ │
│ result ◀────────│ local │◀───┼───│ response │◀────────│ │ │
│ │ polling │ │ │ queue │ │ │ │
│ │ │ │ │ │ │ │ │
│ └─────────┘ │ └──────────┘ └──────────┘ │
│ │ │
└───────────────────────────────────┴──────────────────────────────────────┘
◁ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ▷
returnLatency ◀───────▶
sendResponseLatency
localStartLatency
and executionTime
are measured on one machine and are free of clock skew. remoteStartLatency
and returnLatency
are measured as time differences between machines and are subject to much more uncertainty, and effects like clock skew.
All times are in milliseconds.
Properties
Property |
Modifiers |
Type |
Description |
---|---|---|---|
number |
The number of invocations that were successfully completed. | ||
number |
The number of invocations that resulted in an error. If an invocation is retried, an error is only counted once, no matter how many retries were attempted. | ||
Statistics for amount of time billed. This is similar to FunctionStats.executionTime except each sampled time is rounded up to the next 100ms. | |||
Statistics for function execution time in milliseconds. This is measured as wall clock time inside the cloud function, and does not include the time taken to send the response to the response queue. Note that most cloud providers round up to the next 100ms for pricing. | |||
number |
The number of invocations attempted. If an invocation is retried, this only counts the invocation once. | ||
Statistics for how long invocations stay in the local queue before being sent to the cloud provider. | |||
Statistics for how long requests take to start execution after being sent to the cloud provider. This typically includes remote queueing and cold start times. Because this measurement requires comparing timestamps from different machines, it is subject to clock skew and other effects, and should not be considered highly accurate. It can be useful for detecting excessively high latency problems. Faast.js attempt to correct for clock skew heuristically. | |||
number |
The number of invocation retries attempted. This counts retries attempted by faast.js to recover from transient errors, but does not count retries by the cloud provider. | ||
Statistics for how long it takes to return a response from the end of execution time to the receipt of the response locally. This measurement requires comparing timestamps from different machines, and is subject to clock skew and other effects. It should not be considered highly accurate. It can be useful for detecting excessively high latency problems. Faast.js attempts to correct for clock skew heuristically. | |||
Statistics for how long it takes to send the response to the response queue. |
Methods
Method |
Modifiers |
Description |
---|---|---|
Summarize the function stats as a string. |