Skip to content

Commit efc64e8

Browse files
author
Unity Technologies
committed
com.unity.test-framework.performance@0.1.27-preview
# Changelog ## [0.1.27] - 2018-5-31 ### Add meta files to npm ignore ## [0.1.26] - 2018-5-31 ### Preparing package for moving to public registry Inversed changelog order Excluded CI files from published package ## [0.1.25] - 2018-5-31 ### Remove missing meta files ## [0.1.24] - 2018-5-31 ### Print out json to xml by default for backwards compatability ## [0.1.23] - 2018-5-30 ### Issues with packman, bumping up version Issues with packman, bumping up version ## [0.1.22] - 2018-5-29 ### Measure.Method Execution and Warmup count Can now specify custom execution and warmup count ## [0.1.21] - 2018-5-25 ### Fix issues introduced by .18 fix ## [0.1.19] - 2018-5-24 ### Rename package Package has been renamed to `com.unity.test-framework.performance` to match test framework ## [0.1.18] - 2018-5-24 ### Fix SetUp and TearDown for 2018.1 ## [0.1.17] - 2018-5-23 ### Meatada collecting and changes to method/frames measurements Refactor Method and Frames measurements Metadata collected using internal test runner API and player connection for 2018.3+ ## [0.1.16] - 2018-5-09 ### Bug fix Bug fix regarding measureme methods being disposed twice ## [0.1.15] - 2018-5-02 ### Bug fix for metadata test The test was failing if a json file was missing for playmode tests ## [0.1.14] - 2018-4-30 ### Measure method refactor Introduced SampleGroupDefinition Addition of measuring a method or frames for certain amount of times or for duration Refactored measuring methods Removes linq usage for due to issues with AOT platforms ## [0.1.13] - 2018-4-15 ### Updates to aggregation and metadata for android Fixed android metadata collecting Removed totaltime from frametime measurements Added total, std and sample count aggregations Added sample unit to multi sample groups ## [0.1.12] - 2018-4-11 ### Change naming and fix json serialization ## [0.1.11] - 2018-4-09 ### Fix 2018.1 internal namespaces Fix 2018.1 internal namespaces ## [0.1.10] - 2018-4-09 ### Collect metadata and update coding style Change fields to UpperCamelCase Added editmode and playmode tests that collect metadata ## [0.1.9] - 2018-4-06 ### Add json output for 2018.1 After test run, we will now print json output ## [0.1.8] - 2018-4-03 ### Fix for 2018.1 Fix an exception on 2018.1 ## [0.1.7] - 2018-4-03 ### improvements to overloads and documentation Changed some of the names to match new convention Addressed typos in docs Multiple overloads replaced by using default arguments ## [0.1.6] - 2018-3-28 ### improvements to overloads and documentation Measure.Custom got a new overload with SampleGroup Readme now includes installation and more examples ## [0.1.5] - 2018-3-20 ### Adding checks for usage outside of Performance tests Adding checks for usage outside of Performance tests ## [0.1.4] - 2018-3-20 ### Adding system info to performance test output Preparing for reporting test data ## [0.1.3] - 2018-03-14 ### Removed tests Temporarily removing tests from the package into separate repo. ## [0.1.2] - 2018-03-14 ### Bug fix Update for a missing bracket ## [0.1.1] - 2018-03-14 ### Updates to test results and measurement methods Test output now includes json that can be used to parse performance data from TestResults.xml Added defines to be compatible with 2018.1 and newer Removed unnecessary overloads for measurements due to introduction of SampleGroup Measurement methods can now take in SampleGroup as argument. ## [0.1.0] - 2018-02-27 ### This is the first release of *Unity Package performancetesting*. Initial version.
0 parents  commit efc64e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2803
-0
lines changed

CHANGELOG.md

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Changelog
2+
3+
4+
## [0.1.27] - 2018-5-31
5+
6+
### Add meta files to npm ignore
7+
8+
## [0.1.26] - 2018-5-31
9+
10+
### Preparing package for moving to public registry
11+
12+
Inversed changelog order
13+
Excluded CI files from published package
14+
15+
16+
## [0.1.25] - 2018-5-31
17+
18+
### Remove missing meta files
19+
20+
21+
## [0.1.24] - 2018-5-31
22+
23+
### Print out json to xml by default for backwards compatability
24+
25+
26+
## [0.1.23] - 2018-5-30
27+
28+
### Issues with packman, bumping up version
29+
30+
Issues with packman, bumping up version
31+
32+
33+
## [0.1.22] - 2018-5-29
34+
35+
### Measure.Method Execution and Warmup count
36+
37+
Can now specify custom execution and warmup count
38+
39+
40+
## [0.1.21] - 2018-5-25
41+
42+
### Fix issues introduced by .18 fix
43+
44+
45+
## [0.1.19] - 2018-5-24
46+
47+
### Rename package
48+
49+
Package has been renamed to `com.unity.test-framework.performance` to match test framework
50+
51+
52+
## [0.1.18] - 2018-5-24
53+
54+
### Fix SetUp and TearDown for 2018.1
55+
56+
57+
## [0.1.17] - 2018-5-23
58+
59+
### Meatada collecting and changes to method/frames measurements
60+
61+
Refactor Method and Frames measurements
62+
Metadata collected using internal test runner API and player connection for 2018.3+
63+
64+
65+
## [0.1.16] - 2018-5-09
66+
67+
### Bug fix
68+
69+
Bug fix regarding measureme methods being disposed twice
70+
71+
72+
## [0.1.15] - 2018-5-02
73+
74+
### Bug fix for metadata test
75+
76+
The test was failing if a json file was missing for playmode tests
77+
78+
79+
## [0.1.14] - 2018-4-30
80+
81+
### Measure method refactor
82+
83+
Introduced SampleGroupDefinition
84+
Addition of measuring a method or frames for certain amount of times or for duration
85+
Refactored measuring methods
86+
Removes linq usage for due to issues with AOT platforms
87+
88+
89+
## [0.1.13] - 2018-4-15
90+
91+
### Updates to aggregation and metadata for android
92+
93+
Fixed android metadata collecting
94+
Removed totaltime from frametime measurements
95+
Added total, std and sample count aggregations
96+
Added sample unit to multi sample groups
97+
98+
99+
## [0.1.12] - 2018-4-11
100+
101+
### Change naming and fix json serialization
102+
103+
104+
## [0.1.11] - 2018-4-09
105+
106+
### Fix 2018.1 internal namespaces
107+
108+
Fix 2018.1 internal namespaces
109+
110+
111+
## [0.1.10] - 2018-4-09
112+
113+
### Collect metadata and update coding style
114+
115+
Change fields to UpperCamelCase
116+
Added editmode and playmode tests that collect metadata
117+
118+
119+
## [0.1.9] - 2018-4-06
120+
121+
### Add json output for 2018.1
122+
123+
After test run, we will now print json output
124+
125+
126+
## [0.1.8] - 2018-4-03
127+
128+
### Fix for 2018.1
129+
130+
Fix an exception on 2018.1
131+
132+
133+
## [0.1.7] - 2018-4-03
134+
135+
### improvements to overloads and documentation
136+
137+
Changed some of the names to match new convention
138+
Addressed typos in docs
139+
Multiple overloads replaced by using default arguments
140+
141+
142+
## [0.1.6] - 2018-3-28
143+
144+
### improvements to overloads and documentation
145+
146+
Measure.Custom got a new overload with SampleGroup
147+
Readme now includes installation and more examples
148+
149+
150+
## [0.1.5] - 2018-3-20
151+
152+
### Adding checks for usage outside of Performance tests
153+
154+
Adding checks for usage outside of Performance tests
155+
156+
157+
## [0.1.4] - 2018-3-20
158+
159+
### Adding system info to performance test output
160+
161+
Preparing for reporting test data
162+
163+
164+
## [0.1.3] - 2018-03-14
165+
166+
### Removed tests
167+
168+
Temporarily removing tests from the package into separate repo.
169+
170+
171+
## [0.1.2] - 2018-03-14
172+
173+
### Bug fix
174+
175+
Update for a missing bracket
176+
177+
178+
## [0.1.1] - 2018-03-14
179+
180+
### Updates to test results and measurement methods
181+
182+
Test output now includes json that can be used to parse performance data from TestResults.xml
183+
Added defines to be compatible with 2018.1 and newer
184+
Removed unnecessary overloads for measurements due to introduction of SampleGroup
185+
Measurement methods can now take in SampleGroup as argument.
186+
187+
188+
## [0.1.0] - 2018-02-27
189+
190+
### This is the first release of *Unity Package performancetesting*.
191+
192+
Initial version.

CHANGELOG.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
#if !UNITY_2018_3_OR_NEWER
2+
3+
using System;
4+
using System.IO;
5+
using NUnit.Framework;
6+
using Unity.PerformanceTesting;
7+
using UnityEditor;
8+
using UnityEngine;
9+
using UnityEngine.TestTools;
10+
using UnityEngine.XR;
11+
12+
public class EditmodeMetadataCollector : IPrebuildSetup
13+
{
14+
private PerformanceTestRun m_TestRun;
15+
16+
private string m_TestRunPath
17+
{
18+
get { return Path.Combine(Application.streamingAssetsPath, "PerformanceTestRunInfo.json"); }
19+
}
20+
21+
[Test]
22+
public void GetPlayerSettingsTest()
23+
{
24+
m_TestRun = ReadPerformanceTestRunJson();
25+
m_TestRun.PlayerSystemInfo = GetSystemInfo();
26+
m_TestRun.PlayerSettings = GetPlayerSettings();
27+
m_TestRun.TestSuite = "Editmode";
28+
29+
TestContext.Out.Write("##performancetestruninfo:" + JsonUtility.ToJson(m_TestRun));
30+
}
31+
32+
public void Setup()
33+
{
34+
m_TestRun = new PerformanceTestRun
35+
{
36+
EditorVersion = GetEditorInfo(),
37+
BuildSettings = GetPlayerBuildInfo(),
38+
StartTime = DateTime.Now.ToUniversalTime().Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc))
39+
.TotalMilliseconds
40+
};
41+
42+
CreateStreamingAssetsFolder();
43+
CreatePerformanceTestRunJson();
44+
}
45+
46+
private void CreateStreamingAssetsFolder()
47+
{
48+
if (!Directory.Exists(Application.streamingAssetsPath))
49+
{
50+
AssetDatabase.CreateFolder("Assets", "StreamingAssets");
51+
}
52+
}
53+
54+
private void CreatePerformanceTestRunJson()
55+
{
56+
string json = JsonUtility.ToJson(m_TestRun, true);
57+
File.WriteAllText(m_TestRunPath, json);
58+
AssetDatabase.Refresh();
59+
}
60+
61+
private PerformanceTestRun ReadPerformanceTestRunJson()
62+
{
63+
string json = File.ReadAllText(m_TestRunPath);
64+
return JsonUtility.FromJson<PerformanceTestRun>(json);
65+
}
66+
67+
private static PlayerSystemInfo GetSystemInfo()
68+
{
69+
return new PlayerSystemInfo
70+
{
71+
OperatingSystem = SystemInfo.operatingSystem,
72+
DeviceModel = SystemInfo.deviceModel,
73+
DeviceName = SystemInfo.deviceName,
74+
ProcessorType = SystemInfo.processorType,
75+
ProcessorCount = SystemInfo.processorCount,
76+
XrModel = XRDevice.model,
77+
GraphicsDeviceName = SystemInfo.graphicsDeviceName,
78+
SystemMemorySize = SystemInfo.systemMemorySize,
79+
#if ENABLE_VR
80+
XrDevice = XRSettings.loadedDeviceName
81+
#endif
82+
};
83+
}
84+
85+
private static EditorVersion GetEditorInfo()
86+
{
87+
return new EditorVersion
88+
{
89+
FullVersion = UnityEditorInternal.InternalEditorUtility.GetFullUnityVersion(),
90+
DateSeconds = int.Parse(UnityEditorInternal.InternalEditorUtility.GetUnityVersionDate().ToString()),
91+
Branch = GetEditorBranch(),
92+
RevisionValue = int.Parse(UnityEditorInternal.InternalEditorUtility.GetUnityRevision().ToString())
93+
};
94+
}
95+
96+
private static string GetEditorBranch()
97+
{
98+
foreach (var method in typeof(UnityEditorInternal.InternalEditorUtility).GetMethods())
99+
{
100+
if (method.Name.Contains("GetUnityBuildBranch"))
101+
{
102+
return (string) method.Invoke(null, null);
103+
}
104+
}
105+
106+
return "null";
107+
}
108+
109+
private static Unity.PerformanceTesting.BuildSettings GetPlayerBuildInfo()
110+
{
111+
var buildSettings = new Unity.PerformanceTesting.BuildSettings
112+
{
113+
Platform = Application.platform.ToString(),
114+
BuildTarget = UnityEditor.EditorUserBuildSettings.activeBuildTarget.ToString(),
115+
DevelopmentPlayer = UnityEditor.EditorUserBuildSettings.development,
116+
AndroidBuildSystem = UnityEditor.EditorUserBuildSettings.androidBuildSystem.ToString()
117+
};
118+
return buildSettings;
119+
}
120+
121+
122+
private static Unity.PerformanceTesting.PlayerSettings GetPlayerSettings()
123+
{
124+
return new Unity.PerformanceTesting.PlayerSettings()
125+
{
126+
VrSupported = UnityEditor.PlayerSettings.virtualRealitySupported,
127+
MtRendering = UnityEditor.PlayerSettings.MTRendering,
128+
GpuSkinning = UnityEditor.PlayerSettings.gpuSkinning,
129+
GraphicsJobs = UnityEditor.PlayerSettings.graphicsJobs,
130+
GraphicsApi =
131+
UnityEditor.PlayerSettings.GetGraphicsAPIs(UnityEditor.EditorUserBuildSettings.activeBuildTarget)[0]
132+
.ToString(),
133+
ScriptingBackend = UnityEditor.PlayerSettings
134+
.GetScriptingBackend(UnityEditor.EditorUserBuildSettings.selectedBuildTargetGroup)
135+
.ToString(),
136+
StereoRenderingPath = UnityEditor.PlayerSettings.stereoRenderingPath.ToString(),
137+
RenderThreadingMode = UnityEditor.PlayerSettings.graphicsJobs ? "GraphicsJobs" :
138+
UnityEditor.PlayerSettings.MTRendering ? "MultiThreaded" : "SingleThreaded",
139+
AndroidMinimumSdkVersion = UnityEditor.PlayerSettings.Android.minSdkVersion.ToString(),
140+
AndroidTargetSdkVersion = UnityEditor.PlayerSettings.Android.targetSdkVersion.ToString(),
141+
Batchmode = UnityEditorInternal.InternalEditorUtility.inBatchMode.ToString()
142+
// @TODO playerSettings.EnabledXrTargets need to set this from Prebuild Setup method
143+
//EnabledXrTargets = TODO
144+
};
145+
// TODO currently no api on 2018.1
146+
//playerSettings.StaticBatching = TODO
147+
//playerSettings.DynamicBatching = TODO
148+
//PlayerSettings.GetBatchingForPlatform(EditorUserBuildSettings.activeBuildTarget, out pbi.staticBatching, out pbi.dynamicBatching);
149+
}
150+
}
151+
#endif

Editor/EditmodeMetadataCollector.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)