Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

12 Commits

Repository files navigation

Performance Test Report Viewer

This tool extends Unity's performance testing API to run various types of tests and visualize them in charts.

When you create multiple tests and want to compare the results, this tool will help you to compare the results of the tests in a chart.

img

Compare testsParameterized tests
imgimg

Prerequisites

API Compatibility Level : .Net Framework
Unity Version : 2022.3.14f1 Performance testing API : 3.0.3

Installiation

Unity>Package Manager>Add package from git URL...

  • https://github.com/penspanic/UnityPerformanceTestReportViewer.git

or

git clone https://github.com/penspanic/UnityPerformanceTestReportViewer.git
Unity>Package Manager>Add package from disk...>path_to_UnityPerformanceTestReportViewer

Usage

Write tests

Sample test codes are available in Package Samples.
img

Simple test

[SampleDefinitionContainer]publicstaticclassSimpleTestDefinitions{publicconststringCategory="SimpleTest";publicstaticreadonlyISampleDefinitionValue1=newDefaultSampleDefinition("Value1",Category,SampleUnit.Byte);publicstaticreadonlyISampleDefinitionValue2=newDefaultSampleDefinition("Value2",Category,SampleUnit.Byte);publicstaticreadonlyISampleDefinitionValue3=newDefaultSampleDefinition("Value3",Category,SampleUnit.Byte);}publicclassSimpleTest{[Test,Performance]publicvoidTest(){usingvarsampleGroups=newSampleGroups();using(sampleGroups.CreateScope(SimpleTestDefinitions.Value1))Console.WriteLine("Do something");using(sampleGroups.CreateScope(SimpleTestDefinitions.Value2))Console.WriteLine("Do something");using(sampleGroups.CreateScope(SimpleTestDefinitions.Value3))Console.WriteLine("Do something");}}

Grouped test

You can visualize the results of multiple tests in a single chart.

Parameterized test
publicclassParameterizedTest{[Test,Performance]publicvoidTest([Values(1,2,3,4,5)]intparameter){usingvarsampleGroups=newSampleGroups();using(sampleGroups.CreateScope(SimpleTestDefinitions.Value1))Console.WriteLine("Do something");}}
Comparable test
[ComparableTest]publicclassGroupedTest{[Test,Performance]publicvoidTest1(){usingvarsampleGroups=newSampleGroups();using(sampleGroups.CreateScope(SimpleTestDefinitions.Value1))Console.WriteLine("Do something");}[Test,Performance]publicvoidTest2(){usingvarsampleGroups=newSampleGroups();using(sampleGroups.CreateScope(SimpleTestDefinitions.Value1))Console.WriteLine("Do something");}[Test,Performance]publicvoidTest3(){usingvarsampleGroups=newSampleGroups();using(sampleGroups.CreateScope(SimpleTestDefinitions.Value1))Console.WriteLine("Do something");}}

Run tests

Written tests will be displayed in the Unity Test Runner window. Run the tests.

View results

Open PerformanceTestReportViewer window.
(Window/Analysis/Performance Test Report Viewer, Ctrl+Shift+Alt+V)

Some viewing options are available in the window.
img

Extensions

Unity.Entities Extension

Provides an extension for testing Unity.Entities. In particular, it provides performance testing extensions for ECS World.
Package Manager>Performance Test ReportViewer>Samples>Unity.Entities Extensions

About

This tool extends Unity's performance testing API to run various types of tests and visualize them in charts.

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages