From 17df4185ce09f7fb911dc72e1974231a1ff14a12 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 2 Feb 2012 18:42:27 +0000 Subject: Add stress tests for simple object add of 100 prim objects. Add time taken to output (this is unreliable). --- OpenSim/Tests/Torture/ObjectTortureTests.cs | 51 +++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 14 deletions(-) (limited to 'OpenSim/Tests/Torture') diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs index cdbaa66..b9764d7 100644 --- a/OpenSim/Tests/Torture/ObjectTortureTests.cs +++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs @@ -59,33 +59,60 @@ namespace OpenSim.Tests.Torture // } [Test] - public void Test0001TenThousandObjects() + public void Test0001_10K_1PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - TestAddObjects(10000); + TestAddObjects(1, 10000); } [Test] - public void Test0002OneHundredThousandObjects() + public void Test0002_100K_1PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - TestAddObjects(100000); + TestAddObjects(1, 100000); } [Test] - public void Test0003TwoHundredThousandObjects() + public void Test0003_200K_1PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - TestAddObjects(200000); + TestAddObjects(1, 200000); } - private void TestAddObjects(int objectsToAdd) + [Test] + public void Test0011_100_100PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(100, 100); + } + + [Test] + public void Test0012_1K_100PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(100, 1000); + } + + [Test] + public void Test0013_2K_100PrimObjects() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + TestAddObjects(100, 2000); + } + + private void TestAddObjects(int primsInEachObject, int objectsToAdd) { UUID ownerId = new UUID("F0000000-0000-0000-0000-000000000000"); @@ -98,7 +125,7 @@ namespace OpenSim.Tests.Torture for (int i = 1; i <= objectsToAdd; i++) { - SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, ownerId, "part_", i); + SceneObjectGroup so = SceneHelpers.CreateSceneObject(primsInEachObject, ownerId, "part_", i); Assert.That(scene.AddNewSceneObject(so, false), Is.True, string.Format("Object {0} was not created", i)); } @@ -114,13 +141,9 @@ namespace OpenSim.Tests.Torture string.Format("Object {0} could not be retrieved", i)); } -// Console.WriteLine( -// "Took {0}ms, {1}MB to create {2} single prim scene objects", -// elapsed.Milliseconds, processGcAlloc / 1024 / 1024, objectsToAdd); - Console.WriteLine( - "Took {0}MB to create {1} single prim scene objects", - processGcAlloc / 1024 / 1024, objectsToAdd); + "Took {0}ms, {1}MB to create {2} objects each containing {3} prim(s)", + Math.Round(elapsed.TotalMilliseconds), processGcAlloc / 1024 / 1024, objectsToAdd, primsInEachObject); } } } \ No newline at end of file -- cgit v1.1