Skip to content

actor charge support #745

Open
Open
@netmilk

Description

As discussed with @mhamas, I'd like to introduce Actor.charge() equivalent to the Apify CLI actor namespace. It should work locally (without the run id an the run API key) as well as in the production deployment on Apify. Locally it should log to stderr every charge event on apify run and output the aggregated breakdown of event charges at the end of the run.

Syntax proposal:

$ apify actor charge <EVENT_NAME> \
[--eventCount <EVENT_COUNT>] \
[--idempotency-key <IDEMPOTENCY_KEY>]
...
Pay Per Event fired: <amount>, <count> times
...


Charges Breakdown:
-----------------------------------------------
|  <event name> | <count> |  <each> | <total>  |
...    
-----------------------------------------------
| Grand total: <sum>                                            |
-----------------------------------------------
...
$ echo $?
0

Metadata

Assignees

No one assigned

    Labels

    t-toolingIssues with this label are in the ownership of the tooling team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions