In this example, they use 10 counts and 20 KB size for player_executed_cloudscript to calculate the average size of PlayStream events. But I don't know how to get the size of my PlayStream events.
https://docs.microsoft.com/en-us/gaming/playfab/features/pricing/meters/meters#example
In my case, should I use 15240(MemoryConsumedBytes) for PlayStream event size or is 15240 not the size of this PlayStream event?
My event data:
{ "PlayFabEnvironment": { "Application": "logicserver", "Vertical": "master", "Commit": "e077f68", "Cloud": "main" }, "EventNamespace": "com.playfab", "SourceType": "BackEnd", "EntityType": "player", "EventName": "player_executed_cloudscript", "Timestamp": "2021-01-08T12:52:41.2343997Z", "FunctionName": "GetPlayerAvatar", "CloudScriptExecutionResult": { "FunctionName": "GetPlayerAvatar", "ExecutionTimeSeconds": 0.0235788, "ProcessorTimeSeconds": 0, "MemoryConsumedBytes": 15240, "HttpRequestsIssued": 0, "Revision": 111, "APIRequestsIssued": 1, "FunctionResult": { "callsuccessful": true, "avatarnumber": "6", "errorresult": null }, "Logs": [ { "Message": "avatar code is: 6", "Level": "Info" } ] }, "EntityId": "4BA00A0BDD80CDE6", "EventId": "294997f600a94667aab477f2ef20f011", "Source": "CloudScript", "TitleId": "E5E2C" }
Answer by SethDu · Jan 11, 2021 at 08:33 AM
According to the official documentation: Pricing Meters - PlayFab | Microsoft Docs, it is stated that the size of the event is uncompressed and only includes the payload. You may use a string counter tool to measure the size of the above payload. However, PlayFab only counts the total size of the PlayStream Event within a month in the billing summary, the size of a single event is not statistically useful.
The document means that “10 counts and 20 KB size” will be eventually listed in the billing page as “20 counts” for your payment reference.
What exactly is the payload in my example? Is it every character (from line 1. to line 38.) that is in my event data?
Is it necessary to include the names like "PlayFabEnvironment", "Application", "Vertical" in the calculations to measure the size of the payload?
However, PlayFab only counts the total size of the PlayStream Event within a month in the billing summary, the size of a single event is not statistically useful.
I'm not sure if my calculations for the total size of an event are correct.
For example: The event player_executed_cloudscript gets executed 5 times in one month.
1. execution: payload size = 0,30 KB
2. execution: payload size = 0,35 KB
3. execution: payload size = 0,28 KB
4. execution: payload size = 0,36 KB
5. execution: payload size = 0,29 KB
Counts = 5 Total size = 1,58 KB
Is the total size for player_executed_cloudscript event in this example 1,58 KB or is the total size of an event calculated differently?
The payload size in the previous context should be around 1,096 bytes, but it can be slightly different based on some whitespace characters.
Total Size is simply adding up each event's payload size, while the Counts, which is eventually displayed in billing summary, is calculated to be an effective count.
Hence the example you have mentioned -- 5 counts for 1.58KB, will be 5 * 1.58 = 7.9 counts in the billing summary as it is stated in the Example Section of Pricing Meters - PlayFab | Microsoft Docs.
If you want to know more details about the billing metering, you can navigate to this Contact page or email the sales team for help.