Class MetadataCollect
Abstract class for creating a metadata collector type to populate the PackedMemorySnapshot.Metadata
member. You can add multiple collectors, but it is recommended to add only one. A collector instance will auto-register during construction.
Namespace: Unity.MemoryProfiler
Syntax
public abstract class MetadataCollect : IDisposable
Remarks
Creating a collector instance will override the default metadata collection functionality. If you want to keep the default metadata, go to the DefaultCollect
method in the file com.unity.memoryprofiler\Runtime\MetadataInjector.cs and copy that code into your collector method.
Removing a collector can be achieved by calling dispose on the collector instance you want to unregister.
Constructors
MetadataCollect()
Declaration
public MetadataCollect()
Methods
CollectMetadata(MetaData)
The Memory Profiler will invoke this method during the capture process, to populate the metadata of the capture.
Declaration
public abstract void CollectMetadata(MetaData data)
Parameters
Type | Name | Description |
---|---|---|
MetaData | data | The data payload that will get written to the snapshot file. |
Dispose()
Declaration
public void Dispose()