Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / operations/metrics / MetricsTimeWindow

Interface: MetricsTimeWindow

Defined in: packages/b2c-tooling-sdk/src/operations/metrics/index.ts:102

Time-window options common to every metrics operation.

Accepts either a Date or a number of epoch milliseconds (the same unit as Date.now()), for both from and to. Both are optional; when omitted the API applies its default window. When both are supplied, from must be before to or the API returns a 400.

Note: The Metrics API wire format is epoch seconds, and the data points it returns are timestamped in seconds. These operations convert millisecond inputs to seconds on the way out and normalize response timestamps back to milliseconds on the way in, so callers work in JS-native millisecond time throughout (e.g. new Date(point.timestamp)).

Extended by

Properties

from?

optional from: number | Date

Defined in: packages/b2c-tooling-sdk/src/operations/metrics/index.ts:104

Start of the window — a Date or epoch milliseconds (inclusive).


to?

optional to: number | Date

Defined in: packages/b2c-tooling-sdk/src/operations/metrics/index.ts:106

End of the window — a Date or epoch milliseconds (inclusive).

Released under the Apache-2.0 License.