faast.js

faast.js

  • Docs
  • API
  • Community
  • GitHub
  • Blog

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

PropertyModifiersTypeDescription
comment?string(Optional) An optional comment, usually providing a link to the provider's pricing page and other data.
informationalOnly?boolean(Optional) True if this cost metric is only for informational purposes (e.g. AWS's logIngestion) and does not contribute cost.
measurednumberThe measured value of the cost metric, in units.
namestringThe name of the cost metric, e.g. functionCallDuration
pricingnumberThe price in USD per unit measured.
unitstringThe name of the units that pricing is measured in for this metric.
unitPlural?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

MethodModifiersDescription
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.
  • CostMetric class
  • Remarks
  • Properties
  • Methods
faast.js
Docs
IntroductionAPI ReferenceContributingExamples
Community
DiscordTwitterStack Overflowfaast.js
More
BlogUser Showcase
Copyright © 2021 Andy Chou