- Home /
Retrieving Profiler Stats (Android)
So my logcat shows profiler stats in this format :
D/Unity ( 1348): ----------------------------------------
D/Unity ( 1348): Android Unity internal profiler stats:
D/Unity ( 1348): cpu-player> min: 8.1 max: 21.9 avg: 12.8
D/Unity ( 1348): cpu-ogles-drv> min: 0.7 max: 2.3 avg: 1.1
D/Unity ( 1348): cpu-present> min: 11.2 max: 27.7 avg: 21.5
D/Unity ( 1348): frametime> min: 31.3 max: 40.5 avg: 35.4
D/Unity ( 1348): draw-call #> min: 23 max: 27 avg: 23 | batched: 0
D/Unity ( 1348): tris #> min: 8038 max: 8106 avg: 8050 | batched: 6
D/Unity ( 1348): verts #> min: 7958 max: 8094 avg: 7982 | batched: 12
D/Unity ( 1348): player-detail> physx: 1.0 animation: 0.6 culling 0.0 skinning: 0.5 batching: 0.0 render: 4.9 fixed-update-count: 1 .. 2 D/Unity ( 1348): mono-scripts> update: 1.3 fixedUpdate: 0.0 coroutines: 0.1
D/Unity ( 1348): mono-memory> used heap: 4295446528 allocated heap: 4614617861887885312 max number of collections: 1610612736 collection total duration: 0.5
D/Unity ( 1348): ----------------------------------------
Is there anyway I can extract this data and display it in my game?
Answer by ZenithCode · Sep 02, 2013 at 03:26 PM
This script lets you get parts of this data onto the game.
http://forum.unity3d.com/threads/58746-Fatal-error-in-gc-Too-many-heap-sections
Not sure if you gave me the right link there :\ FPS in those scripts aren't taken from the profiler they are made from the output frames of the game. which is probably vertical synced FPS (Not even the real FPS of the game)
You can do something like this to get Total memory usage and $$anonymous$$ono memory usage.
var total$$anonymous$$emoryUsage = Profiler.usedHeapSize / 1024 / 1024;
long memUsed = mono_gc_get_used_size();
Thanks for the info :)
Although the main stat's I would like are Frametime, CPU Usage, Vert/Polygon count, Texture $$anonymous$$emory, Draw call count.
I hope there is a way to get this data as it is clearly being exported to the integrated profiler...
Your answer
Follow this Question
Related Questions
Creating Unity Plugin 1 Answer
How to display profiling data on screen (Android) 2 Answers
Creating Unity Statistics Plugin 0 Answers
perfHUD & Unity 0 Answers
A node in a childnode? 1 Answer