faastjs > CostAnalyzer > Workload
CostAnalyzer.Workload interface
A user-defined cost analyzer workload for CostAnalyzer.analyze().
Example:
Signature:
interface Workload<T extends object, A extends string>
Properties
Property |
Modifiers |
Type |
Description |
---|---|---|---|
number |
(Optional) The amount of concurrency to allow. Concurrency can arise from multiple repetitions of the same configuration, or concurrenct executions of different configurations. This concurrency limit throttles the total number of concurrent workload executions across both of these sources of concurrency. Default: 64. | ||
(Optional) An array of configurations to run the work function against (see CostAnalyzer.Configuration). For example, each entry in the array may specify a provider, memory size, and other options. Default: CostAnalyzer.awsConfigurations. | |||
(attr: A, value: number) => string |
(Optional) Format an attribute value for console output. This is displayed by the cost analyzer when all of the repetitions for a configuration have completed. The default returns | ||
(attr: A, value: number) => string |
(Optional) Format an attribute value for CSV. The default returns | ||
T |
The imported module that contains the cloud functions to test. | ||
number |
(Optional) The number of repetitions to run the workload for each cost analyzer configuration. Higher repetitions help reduce the jitter in the results. Repetitions execute in the same FaastModule instance. Default: 10. | ||
boolean |
(Optional) If true, do not output live results to the console. Can be useful for running the cost analyzer as part of automated tests. Default: false. | ||
(summaries: WorkloadAttribute<A>[]) => WorkloadAttribute<A> |
(Optional) Combine CostAnalyzer.WorkloadAttribute instances returned from multiple workload executions (caused by value of CostAnalyzer.Workload.repetitions). The default is a function that takes the average of each attribute. | ||
(faastModule: FaastModule<T>) => Promise<WorkloadAttribute<A> | void> |
A function that executes cloud functions on |