Repository: ignite Updated Branches: refs/heads/master ee4df59e3 -> 9c2b1e755
.NET: Fix DataRegionMetricsTest Broken by IGNITE-8583 86c18998dbb430c69eb136ffce54858f52432808 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9c2b1e75 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9c2b1e75 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9c2b1e75 Branch: refs/heads/master Commit: 9c2b1e75592de73b27bdac57fa648f9f1c2bdb1f Parents: ee4df59 Author: Pavel Tupitsyn <[email protected]> Authored: Tue Jun 5 00:17:43 2018 +0300 Committer: Pavel Tupitsyn <[email protected]> Committed: Tue Jun 5 00:17:43 2018 +0300 ---------------------------------------------------------------------- .../Cache/DataRegionMetricsTest.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/9c2b1e75/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/DataRegionMetricsTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/DataRegionMetricsTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/DataRegionMetricsTest.cs index cf306e5..b172eaf 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/DataRegionMetricsTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/DataRegionMetricsTest.cs @@ -33,6 +33,9 @@ namespace Apache.Ignite.Core.Tests.Cache /** */ private const string RegionNoMetrics = "regNoMetrics"; + /** System page size overhead, see PageMemoryNoStoreImpl.PAGE_OVERHEAD. */ + private const int PageOverhead = 24; + /// <summary> /// Tests the memory metrics. /// </summary> @@ -57,8 +60,10 @@ namespace Apache.Ignite.Core.Tests.Cache Assert.Greater(memMetrics.PageFillFactor, 0); Assert.Greater(memMetrics.TotalAllocatedPages, 1000); Assert.Greater(memMetrics.PhysicalMemoryPages, 1000); - Assert.AreEqual(memMetrics.TotalAllocatedSize, memMetrics.TotalAllocatedPages * memMetrics.PageSize); - Assert.AreEqual(memMetrics.PhysicalMemorySize, memMetrics.PhysicalMemoryPages * memMetrics.PageSize); + Assert.AreEqual(memMetrics.TotalAllocatedSize, + memMetrics.TotalAllocatedPages * (memMetrics.PageSize + PageOverhead)); + Assert.AreEqual(memMetrics.PhysicalMemorySize, + memMetrics.PhysicalMemoryPages * (memMetrics.PageSize + PageOverhead)); var sysMetrics = metrics[2]; Assert.AreEqual("sysMemPlc", sysMetrics.Name); @@ -77,8 +82,10 @@ namespace Apache.Ignite.Core.Tests.Cache Assert.Greater(memMetrics.PageFillFactor, 0); Assert.Greater(memMetrics.TotalAllocatedPages, 1000); Assert.Greater(memMetrics.PhysicalMemoryPages, 1000); - Assert.AreEqual(memMetrics.TotalAllocatedSize, memMetrics.TotalAllocatedPages * memMetrics.PageSize); - Assert.AreEqual(memMetrics.PhysicalMemorySize, memMetrics.PhysicalMemoryPages * memMetrics.PageSize); + Assert.AreEqual(memMetrics.TotalAllocatedSize, + memMetrics.TotalAllocatedPages * (memMetrics.PageSize + PageOverhead)); + Assert.AreEqual(memMetrics.PhysicalMemorySize, + memMetrics.PhysicalMemoryPages * (memMetrics.PageSize + PageOverhead)); sysMetrics = ignite.GetDataRegionMetrics("sysMemPlc"); Assert.AreEqual("sysMemPlc", sysMetrics.Name);
