JS Task API Reference

Class: StatsService

stats.StatsService

Table of contents

Constructors

Methods

Constructors

constructor

• new StatsService(events, options?)

Parameters

NameType
eventsEventEmitter<TaskExecutorEventsDict, any>
options?StatsServiceOptions

Defined in

src/stats.ts:40

Methods

run

â–¸ run(): Promise<void>

Returns

Promise<void>

Defined in

src/stats.ts:46


end

â–¸ end(): Promise<void>

Returns

Promise<void>

Defined in

src/stats.ts:53


getAllCosts

â–¸ getAllCosts(): Object

Returns the sum of all costs generated by tasks in the total field, and the sum of all paid invoices in paid field

Returns

Object

NameType
totalnumber
paidnumber

Defined in

src/stats.ts:61


getAllCostsSummary

â–¸ getAllCostsSummary(): { Agreement: string ; Provider Name: string ; Task Computed: number ; Cost: undefined | number ; Payment Status: string }[]

Returns an array of agreements and the number of tasks performed on them, as well as total costs and payment status

Returns

{ Agreement: string ; Provider Name: string ; Task Computed: number ; Cost: undefined | number ; Payment Status: string }[]

Defined in

src/stats.ts:76


getComputationTime

â–¸ getComputationTime(): number

Returns the total computation time (in ms) of all tasks

Returns

number

Defined in

src/stats.ts:99


getAll

â–¸ getAll(): Object

Returns

Object

NameType
providersnumber
agreementsnumber
invoicesReceivednumber
invoicesPaidnumber
invoicesUnpaidnumber
invoicesMissingnumber
invoicePaymentRatenumber

Defined in

src/stats.ts:171