docs: Update best practices for PPE Actors and mention negative profit - #2770
Conversation
|
🗑️ Preview for this PR was deleted. |
lisvrijsen
left a comment
There was a problem hiding this comment.
Looks and reads really good. Huge improvement!
What do you think about explicitly stating that the developer should test their Actor with an invalid input? Just charging for an invalid input doesn't necessarily cover the entire platform cost. If the Actor takes 10 min to handle the invalid input, and it charges for 1 event only, then the cost is still a lot higher.
stetizu1
left a comment
There was a problem hiding this comment.
Sorry I did not say which comments are actually important and which are nits (the most important are the ones that I see something factual is confusing)
- and in some you do have the information that I was missing, it is just more down the document. In these cases, maybe add a link. Thanks.
| Limit the number of events. Fewer events make it easier for users to understand your pricing and predict the costs. | ||
|
|
||
| For Actors that produce data, events should map to something concrete in the user's dataset or storage. | ||
| Avoid cases where producing a single result triggers too many events. It makes your Actor more expensive. |
There was a problem hiding this comment.
Hmm, this goes against our google maps scraper 😅 Do we want to present this? It seems like common knowledge.
There was a problem hiding this comment.
Don't underestimate people 🥲
|
|
||
| Synthetic events are predefined by Apify and charged automatically: | ||
|
|
||
| - [`apify-actor-start`](#synthetic-start-event) reduces the costs of starting the Actor. |
There was a problem hiding this comment.
What I meant originally was that I would also expect info in this one sentence what it actually charges for (gb of memory) - to be consistent with result - but if you think this makes more sense, keep it.
| Your profit is calculated from the mentioned formula: | ||
| ### Get event names | ||
|
|
||
| To retrieve the list of all chargeable event names for your Actor, use the [Get Actor](/api/v2/act-get) API endpoint. |
There was a problem hiding this comment.
I didn't even know that 😅
|
|
||
| :::caution Non-graceful aborts are default behavior | ||
|
|
||
| A non-graceful abort stops the run immediately, without emitting `aborting`, so your handler never runs. Don't rely on it and charge for work as soon as it's done. For details, see [Respect user spending limits](#respect-user-spending-limits). |
There was a problem hiding this comment.
Does user-spending-limits have anything in common with non-graceful aborts? They are done manualy
There was a problem hiding this comment.
It's linked since that section focuses on charging work as soon as it's done 🤔 Well, it's definitely not the last rewrite for this article.
TC-MO
left a comment
There was a problem hiding this comment.
Few thoughts and visual nits, otherwise LGTM
| - `post` event: Each charge adds one social media post to the dataset. | ||
| - `profile` event: Each charge adds one user profile to the dataset. | ||
| - `processed-image` event: Each charge adds one processed image to the dataset. | ||
| - `ai-analysis` event: Each charge processes one document through an AI workflow. |
There was a problem hiding this comment.
perhaps a table instead of bullet list?
- Removes outdated info on Actors running indefinitely. - Restructures the whole guide. - Adds missing sections so both SDKs can mirror each other better ([Python PR](apify/apify-sdk-python#1064)) Related to the recent updates to platform docs [#2770](apify/apify-docs#2770).
Preview: https://pr-2770.preview.docs.apify.com/actors/publishing/monetize/pay-per-event
Closes #2634.