ProfilingCommandModule
A static class in Root.Township, Alta.Console.Commands.
Console module profiling: Unity profiler samples, heap dumps and memory snapshots. Play mode only, needs server_owner.
- Listed in Console, logging and analytics
- Attributes
PlayOnly,Module,WithPermissionOnly
Fields
3 private and internal fields
| Member | What it is |
|---|---|
private static TaskCompletionSource<bool> finishUnloading | Task CleanMemDump awaits until the last tracked chunk unloads. |
private static HashSet<Chunk> loadedChunks | Chunks CleanMemDump is waiting on to fully unload. |
private static Logger logger | NLog logger for this module. |
Methods
7 private and internal methods
| Member | What it is |
|---|---|
private static void Callback(string arg1, bool arg2) | Unused debug callback that logs its two arguments. |
private static void ChunkUnloaded(Chunk unloadedChunk) | Handler for a chunk's FullyUnloaded during CleanMemDump; completes the wait once every tracked chunk has unloaded. |
private static async void CleanMemDump(string name = "CleanSlateMemoryDump", string path = "") | profiling cleanslatememory: warns players, waits 90 seconds, kicks everyone, waits for all chunks to unload, then takes a full memory snapshot. |
private static void DumpSize() | profiling dumpsize: writes object size info to a file through UnityHeapEx.HeapDump. |
private static void HeapDump() | profiling heapdump: writes a heap dump through UnityHeapEx.HeapDump. |
private static void MemDump(string name = "memorydump", string path = null) | profiling memorydump: takes a Unity memory profiler snapshot into the memory_dump storage folder (or a given path). |
private static IEnumerator Profile(bool wasProfilingByName, int frames, Action postAction) (iterator) | Coroutine behind Sample: waits the given number of frames, stops the profiler, logs FPS and runs the post action. |