From 664f0648969cd100f5deec8aa6b288052aabcd98 Mon Sep 17 00:00:00 2001 From: xiaoweii Date: Thu, 11 Jul 2024 09:29:08 +0800 Subject: [PATCH] fix: reduce the event record times for github action --- Tests/Runtime/ClickstreamPerformanceTest.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/Runtime/ClickstreamPerformanceTest.cs b/Tests/Runtime/ClickstreamPerformanceTest.cs index 16fe77d..732bf50 100644 --- a/Tests/Runtime/ClickstreamPerformanceTest.cs +++ b/Tests/Runtime/ClickstreamPerformanceTest.cs @@ -30,14 +30,14 @@ public void TestPerformanceWhenUseMemoryCache() }); var stopwatch = new Stopwatch(); stopwatch.Start(); - for (var i = 0; i < 100; i++) + for (var i = 0; i < 20; i++) { ClickstreamAnalytics.Record("testEvent", ClickstreamTests.GetProperties()); } stopwatch.Stop(); var elapsedMilliseconds = (stopwatch.ElapsedTicks / (double)Stopwatch.Frequency) * 1000; - UnityEngine.Debug.Log("Save 100 events cost: " + elapsedMilliseconds + " ms"); + UnityEngine.Debug.Log("Save 20 events cost: " + elapsedMilliseconds + " ms"); Assert.True(elapsedMilliseconds < 16); } @@ -53,14 +53,14 @@ public void TestPerformanceWhenUsePlayerPrefs() }); var stopwatch = new Stopwatch(); stopwatch.Start(); - for (var i = 0; i < 10; i++) + for (var i = 0; i < 5; i++) { - ClickstreamAnalytics.Record("testEvent", ClickstreamTests.GetProperties()); + ClickstreamAnalytics.Record("testEvent"); } stopwatch.Stop(); var elapsedMilliseconds = stopwatch.ElapsedTicks / (double)Stopwatch.Frequency * 1000; - UnityEngine.Debug.Log("Save 10 events cost: " + elapsedMilliseconds + " ms"); + UnityEngine.Debug.Log("Save 5 events cost: " + elapsedMilliseconds + " ms"); Assert.True(elapsedMilliseconds < 16); } }