Open
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