Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix performance issues v5.2 #179

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace NewPlatform.Flexberry.ORM.ODataService.Tests
{
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
Expand Down Expand Up @@ -30,6 +32,7 @@
#if NETCOREAPP
using NewPlatform.Flexberry.ORM.ODataService.Routing;
using ODataServiceSample.AspNetCore;
using System.Runtime.CompilerServices;
#endif

/// <summary>
Expand All @@ -38,7 +41,7 @@
public class BaseODataServiceIntegratedTest : BaseIntegratedTest
{
protected IDataObjectEdmModelBuilder _builder;

public class TestArgs
{
public IUnityContainer UnityContainer { get; set; }
Expand Down Expand Up @@ -145,7 +148,11 @@ public virtual void ActODataService(Action<TestArgs> action)
token.Events.CallbackAfterInternalServerError = AfterInternalServerError;
var args = new TestArgs { UnityContainer = container, DataService = dataService, HttpClient = client, Token = token };
ExternalLangDef.LanguageDef.DataService = dataService;
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
action(args);
stopwatch.Stop();
Assert.True(stopwatch.ElapsedMilliseconds < 3000, $"Operation took longer than 3000ms ({stopwatch.ElapsedMilliseconds}ms). Probably a performance issue.");
}
}
}
Expand Down Expand Up @@ -180,7 +187,12 @@ public virtual void ActODataService(Action<TestArgs> action)

var args = new TestArgs { UnityContainer = container, DataService = dataService, HttpClient = client, Token = token };
ExternalLangDef.LanguageDef.DataService = dataService;

Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
action(args);
stopwatch.Stop();
Assert.True(stopwatch.ElapsedMilliseconds < 3000, $"Operation took longer than 3000ms ({stopwatch.ElapsedMilliseconds}ms). Probably a performance issue.");
}
}
#endif
Expand Down