Table of Contents

Class ContentStatsCollection

Namespace
Microsoft.Xna.Framework.Content.Pipeline
Assembly
MonoGame.Framework.Content.Pipeline.dll

A collection of content building statistics for use in diagnosing content issues.

public class ContentStatsCollection
Inheritance
ContentStatsCollection
Inherited Members

Fields

Extension

The file extension used by the content pipeline after building to store the content statistics.

Read only - cannot be assigned to

public static readonly string Extension

Field Value

string

Properties

PreviousStats

Optionally used for copying stats that were stored in another collection.

public ContentStatsCollection PreviousStats { get; set; }

Property Value

ContentStatsCollection

Stats

The internal content statistics dictionary.

public IReadOnlyDictionary<string, ContentStats> Stats { get; }

Property Value

IReadOnlyDictionary<string, ContentStats>

Methods

CopyPreviousStats(string)

Copy content building stats to the current collection from the PreviousStats.

public void CopyPreviousStats(string sourceFile)

Parameters

sourceFile string

The absolute path to the source asset file.

MergePreviousStats()

Merge in statistics from PreviousStats that do not exist in this collection.

public void MergePreviousStats()

Read(string)

Load the content statistics from a folder.

public static ContentStatsCollection Read(string outputPath)

Parameters

outputPath string

The folder where the .mgstats file can be found.

Returns

ContentStatsCollection

Returns the content statistics or an empty collection.

RecordStats(string, string, string, Type, float)

Store content building stats for a source file.

public void RecordStats(string sourceFile, string destFile, string processorType, Type contentType, float buildSeconds)

Parameters

sourceFile string

The absolute path to the source asset file.

destFile string

The absolute path to the destination content file.

processorType string

The type name of the content processor.

contentType Type

The content type object.

buildSeconds float

The build time in seconds.

Reset()

Clears all the content statistics.

public void Reset()

TryGetStats(string, out ContentStats)

Get the content statistics for a source file and returns true if found.

public bool TryGetStats(string sourceFile, out ContentStats stats)

Parameters

sourceFile string
stats ContentStats

Returns

bool

Write(string)

Write the content statistics to a folder with the .mgstats file name.

public void Write(string outputPath)

Parameters

outputPath string

The folder to write the .mgstats file.