question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

How to make use of Daily APU Usage Details to reduce Profile Reads meter?

I'm trying to follow the Consumption Best Practices article:

as well as Brendan's recommendation in Slack to identify API usage by using Dashboard > Reports > Daily API Usage Details.


In my Daily API usage Details, I see that the APIs with the most Total sent (MB) are:

  • /server/getplayercombinedinfo
  • /logicinternal/executecloudscriptforplayer


However, I'm not really sure what to do with this information yet. I have some follow-up questions:

  1. Q: Is it possible to filter /server/getplayercombinedinfo for a specific player? This would allow me to debug when it is being called too frequently, because I can perform some actions on my test account and observe how many getplayercombinedinfo's get called.
  2. Q: What is "logicinternal" cloudscript? How is it different from /client/executecloudscript?
  3. Q: Is it possible to filter Cloudscript API calls by which function is actually being called? Otherwise, it feels overwhelming for me to try to pinpoint which of many cloudscript functions are the worst offenders.


Any other advice about how to approach this would be appreciated as well!

apis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Sure thing:

1. No, we don't have any per-player reporting on API calls. In general, we'd recommend having a separate Title ID that you use for testing, so that you can set up some automation to run client devices through their paces, and check to see what that looks like in the game's tracking.

2. LogicInternal is just part of the logic flow for legacy Cloud Script. I'm checking on why it even appears in the report (we don't do that for other internal logic hand-off). But Cloud Script is billed based on the number of calls to the externally-available endpoints and the total GB-s of processing, so you can effectively ignore LogicInternal for the purposes of working out how to optimize your costs.

3. The service that puts together the report doesn't have that info. But your automation overview page shows the graph of calls by count, so that's what I'd use. Looking at yours, getPlayerCombinedInfo and getPlayerProfile are overwhelmingly the two most used script handlers.

In general, the reason we point to using the Daily API Usage Details Report in conjunction with the daily CSV from the Billing Summary page is because for a lot of developers, the Profile Read and Write meters are the ones being hit the most (as they read and write data in the player profile frequently). Since the cost there is bound to the total amount of the data read and written, the report makes it relatively easy to see which API calls are generating the most cost. In the case of Cloud Script, you may want to temporarily turn on events for it, in order to get the level of detail you're looking for (though I wouldn't leave that on in a live game, since it'll drive the PlayStream meter up).

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

Thanks for the great answer.

1. Understood. I'll probably just come up with a special monitoring system for these test accounts. That seems much easier than setting up a mirror Title ID since copying over server/matchmaking, cloudscript, automated events, leaderboards, etc. sounds tedious and sounds like I'll mess something up.

3. Thanks. It turns out I was actually already generating PlayStream events for all cloudscript calls just because there used to be no harm in doing so (before pay-as-you-go).

Is there any way I can set up a Data Explorer Query to show only events for a specific player?

https://i.imgur.com/VbwLxCQ.png

I see at the bottom that there is a Player ID column, so it seems like the data is there, but I don't know how to set up the Query. I tried searching for 'playFabId' or 'player' or 'arguments' or 'args' but don't see anything.

0 Likes 0 ·
brendan avatar image brendan Brent Batas (Lisk) commented ·

Hm. It looks like the basic data explorer isn't updating the drop-down with the correct parameters as options. For now, please use the advanced explorer, as it can be used to filter on any element. I'll open a ticket with the team to get the basic explorer updated.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.