Skip to content

Latest commit

 

History

History
256 lines (116 loc) · 2.96 KB

faastjs.costmetric.md

File metadata and controls

256 lines (116 loc) · 2.96 KB
id title hide_title
faastjs.costmetric
CostMetric class
true

faastjs > CostMetric

CostMetric class

A line item in the cost estimate, including the resource usage metric measured and its pricing.

Signature:

export declare class CostMetric 

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the CostMetric class.

Properties

Property

Modifiers

Type

Description

comment?

readonly

string

(Optional) An optional comment, usually providing a link to the provider's pricing page and other data.

informationalOnly?

readonly

boolean

(Optional) True if this cost metric is only for informational purposes (e.g. AWS's logIngestion) and does not contribute cost.

measured

readonly

number

The measured value of the cost metric, in units.

name

readonly

string

The name of the cost metric, e.g. functionCallDuration

pricing

readonly

number

The price in USD per unit measured.

unit

readonly

string

The name of the units that pricing is measured in for this metric.

unitPlural?

readonly

string

(Optional) The plural form of the unit name. By default the plural form will be the name of the unit with "s" appended at the end, unless the last letter is capitalized, in which case there is no plural form (e.g. "GB").

Methods

Method

Modifiers

Description

cost()

The cost contribution of this cost metric. Equal to CostMetric.pricing * CostMetric.measured.

describeCostOnly()

Return a string with the cost estimate for this metric, omitting comments.

toString()

Describe this cost metric, including comments.