Add profiler
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using Translate.Interface;
|
using Translate.Interface;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using MarketData.Utils;
|
||||||
|
|
||||||
namespace Translate.Services
|
namespace Translate.Services
|
||||||
{
|
{
|
||||||
@@ -14,6 +15,24 @@ namespace Translate.Services
|
|||||||
public class MainService : IMainService
|
public class MainService : IMainService
|
||||||
{
|
{
|
||||||
public void RunService(String[] args,IConfiguration configuration)
|
public void RunService(String[] args,IConfiguration configuration)
|
||||||
|
{
|
||||||
|
Profiler profiler = new Profiler();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Translate(args, configuration);
|
||||||
|
}
|
||||||
|
catch(Exception exception)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{exception.ToString()}");
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Translate done, total took {Utility.FormatNumber(profiler.End(),0,true)}(ms");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Translate(String[] args,IConfiguration configuration)
|
||||||
{
|
{
|
||||||
bool includeInserts = true;
|
bool includeInserts = true;
|
||||||
bool useMaxLines = false;
|
bool useMaxLines = false;
|
||||||
@@ -129,8 +148,6 @@ namespace Translate.Services
|
|||||||
streamWriter.Flush();
|
streamWriter.Flush();
|
||||||
streamWriter.Close();
|
streamWriter.Close();
|
||||||
streamWriter.Dispose();
|
streamWriter.Dispose();
|
||||||
|
|
||||||
Console.WriteLine("Done.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,10 @@
|
|||||||
<AssemblyName>translate</AssemblyName>
|
<AssemblyName>translate</AssemblyName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\MarketData\MarketDataLib/MarketDataLib.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.3.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.3.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.3" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.3" />
|
||||||
|
|||||||
Reference in New Issue
Block a user