Skip to content

Commit 56c3d8b

Browse files
authored
Merge pull request #352 from exceptionless/feature/performance
Improve Pipeline performance and overhead
2 parents 632fb82 + 9ad3efd commit 56c3d8b

File tree

72 files changed

+913
-348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+913
-348
lines changed

Exceptionless.sln

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27130.2010
4+
VisualStudioVersion = 15.0.27130.2027
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exceptionless.Core", "src\Exceptionless.Core\Exceptionless.Core.csproj", "{3E5B39D5-7ACD-486B-9F90-59116B67952D}"
77
EndProject
@@ -60,6 +60,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StackSnapshotJob", "src\Job
6060
EndProject
6161
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exceptionless.Web", "src\Exceptionless.Web\Exceptionless.Web.csproj", "{39353DAF-044D-4AF6-84DA-6EF178F70E50}"
6262
EndProject
63+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StackEventCountJob", "src\Jobs\StackEventCount\StackEventCountJob.csproj", "{BF78AB22-5303-4BA0-AEC5-BF9643A0BF7C}"
64+
EndProject
6365
Global
6466
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6567
Debug|Any CPU = Debug|Any CPU
@@ -146,6 +148,10 @@ Global
146148
{39353DAF-044D-4AF6-84DA-6EF178F70E50}.Debug|Any CPU.Build.0 = Debug|Any CPU
147149
{39353DAF-044D-4AF6-84DA-6EF178F70E50}.Release|Any CPU.ActiveCfg = Release|Any CPU
148150
{39353DAF-044D-4AF6-84DA-6EF178F70E50}.Release|Any CPU.Build.0 = Release|Any CPU
151+
{BF78AB22-5303-4BA0-AEC5-BF9643A0BF7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
152+
{BF78AB22-5303-4BA0-AEC5-BF9643A0BF7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
153+
{BF78AB22-5303-4BA0-AEC5-BF9643A0BF7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
154+
{BF78AB22-5303-4BA0-AEC5-BF9643A0BF7C}.Release|Any CPU.Build.0 = Release|Any CPU
149155
EndGlobalSection
150156
GlobalSection(SolutionProperties) = preSolution
151157
HideSolutionNode = FALSE
@@ -166,6 +172,7 @@ Global
166172
{94868E31-26EF-4705-93C0-F4E1E75F0B07} = {4F070E46-F0D4-4134-A04E-BD1CB3B4AEA3}
167173
{25BAB233-B1B6-4888-BE57-263E1D5A0CE6} = {4F070E46-F0D4-4134-A04E-BD1CB3B4AEA3}
168174
{2B4EB8F1-D73A-4F43-A25A-4194A55CC0B6} = {4F070E46-F0D4-4134-A04E-BD1CB3B4AEA3}
175+
{BF78AB22-5303-4BA0-AEC5-BF9643A0BF7C} = {4F070E46-F0D4-4134-A04E-BD1CB3B4AEA3}
169176
EndGlobalSection
170177
GlobalSection(ExtensibilityGlobals) = postSolution
171178
SolutionGuid = {1A90AFA5-B81C-4B1B-9DFA-2D90F8CA0EF0}

Exceptionless.sln.DotSettings

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp71</s:String>
23
<s:Boolean x:Key="/Default/CodeEditing/GenerateMemberBody/CopyXmlDocumentation/@EntryValue">True</s:Boolean>
34
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/AutoCompleteBasicCompletion/@EntryValue">True</s:Boolean>
45
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/AutoCompleteImportCompletion/@EntryValue">True</s:Boolean>

build/Push-Artifacts.ps1

+6-4
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ git rm -r * -q 2>&1 | %{ "$_" }
3737

3838
Write-Host "Copying build artifacts..."
3939
ROBOCOPY "$sourceDir\Exceptionless.Web" "$artifactsDir" /XD "$sourceDir\Exceptionless.Web\bin" "$sourceDir\Exceptionless.Web\obj" "$sourceDir\Exceptionless.Web\Properties" /S /XF "*.nuspec" "*.settings" "*.cs" "*.Development.yml" "*.csproj" "*.user" "*.suo" "*.xsd" "*.ide" /NFL /NDL /NJH /NJS /nc /ns /np
40-
ROBOCOPY "$sourceDir\Jobs\EventPost\bin\Release\netcoreapp2.0\publish" "$artifactsDir\bin" /S /XF "*.yml" "Web.config" /NFL /NDL /NJH /NJS /nc /ns /np
4140
ROBOCOPY "$sourceDir\Exceptionless.Web\bin\Release\netcoreapp2.0\publish" "$artifactsDir\bin" /XD "$sourceDir\Exceptionless.Web\bin\Release\netcoreapp2.0\publish\wwwroot" /S /XF "*.yml" "Web.config" /NFL /NDL /NJH /NJS /nc /ns /np
41+
ROBOCOPY "$sourceDir\Jobs\EventPost\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\bin" /S /XF "EventPostsJob.*" "*.yml" /NFL /NDL /NJH /NJS /nc /ns /np
4242

4343
Write-Host "Copying CleanupSnapshot job..."
4444
ROBOCOPY "$sourceDir\Jobs\CleanupSnapshot\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\triggered\CleanupSnapshot" "CleanupSnapshot*" "appsettings*.yml" "run.bat" "settings.job" /NFL /NDL /NJH /NJS /nc /ns /np
4545
Write-Host "Copying CloseInactiveSession job..."
46-
ROBOCOPY "$sourceDir\Jobs\CloseInactiveSession\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\continuous\CloseInactiveSession" "CloseInactiveSession*" "appsettings*.yml" "run.bat" /NFL /NDL /NJH /NJS /nc /ns /np
46+
ROBOCOPY "$sourceDir\Jobs\CloseInactiveSession\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\continuous\CloseInactiveSession" "CloseInactiveSession*" "appsettings*.yml" "run.bat" "settings.job" /NFL /NDL /NJH /NJS /nc /ns /np
4747
Write-Host "Copying DailySummary job..."
48-
ROBOCOPY "$sourceDir\Jobs\DailySummary\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\continuous\DailySummary" "DailySummary*" "appsettings*.yml" "run.bat" /NFL /NDL /NJH /NJS /nc /ns /np
48+
ROBOCOPY "$sourceDir\Jobs\DailySummary\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\continuous\DailySummary" "DailySummary*" "appsettings*.yml" "run.bat" "settings.job" /NFL /NDL /NJH /NJS /nc /ns /np
4949
Write-Host "Copying DownloadGeoIPDatabase job..."
5050
ROBOCOPY "$sourceDir\Jobs\DownloadGeoIPDatabase\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\triggered\DownloadGeoIPDatabase" "DownloadGeoIPDatabase*" "appsettings*.yml" "run.bat" "settings.job" /NFL /NDL /NJH /NJS /nc /ns /np
5151
Write-Host "Copying EventNotification job..."
@@ -66,7 +66,9 @@ ROBOCOPY "$sourceDir\Jobs\MaintainIndexes\bin\Release\netcoreapp2.0\publish" "$a
6666
Write-Host "Copying OrganizationSnapshot job..."
6767
ROBOCOPY "$sourceDir\Jobs\OrganizationSnapshot\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\triggered\OrganizationSnapshot" "OrganizationSnapshot*" "appsettings*.yml" "run.bat" "settings.job" /NFL /NDL /NJH /NJS /nc /ns /np
6868
Write-Host "Copying RetentionLimit job..."
69-
ROBOCOPY "$sourceDir\Jobs\RetentionLimit\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\continuous\RetentionLimit" "RetentionLimit*" "appsettings*.yml" "run.bat" /NFL /NDL /NJH /NJS /nc /ns /np
69+
ROBOCOPY "$sourceDir\Jobs\RetentionLimit\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\continuous\RetentionLimit" "RetentionLimit*" "appsettings*.yml" "run.bat" "settings.job" /NFL /NDL /NJH /NJS /nc /ns /np
70+
Write-Host "Copying StackEventCount job..."
71+
ROBOCOPY "$sourceDir\Jobs\StackEventCount\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\continuous\StackEventCount" "StackEventCount*" "appsettings*.yml" "run.bat" "settings.job" /NFL /NDL /NJH /NJS /nc /ns /np
7072
Write-Host "Copying StackSnapshot job..."
7173
ROBOCOPY "$sourceDir\Jobs\StackSnapshot\bin\Release\netcoreapp2.0\publish" "$artifactsDir\App_Data\jobs\triggered\StackSnapshot" "StackSnapshot*" "appsettings*.yml" "run.bat" "settings.job" /NFL /NDL /NJH /NJS /nc /ns /np
7274
Write-Host "Copying WebHook job..."

build/common.props

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
<ProjectParentDirectoryName>$([System.IO.Path]::GetFileName('$(ProjectParentDirectory)'))</ProjectParentDirectoryName>
77
</PropertyGroup>
88

9-
<Import Project="sourcelink.props" Condition="'$(ProjectParentDirectoryName)' == 'Source'" />
10-
119
<ItemGroup>
1210
<PackageReference Include="AsyncFixer" Version="1.1.5" PrivateAssets="All" />
1311
</ItemGroup>
1412

1513
<PropertyGroup>
1614
<Product>Exceptionless</Product>
17-
<Copyright>Copyright (c) 2017 Exceptionless. All rights reserved.</Copyright>
15+
<Copyright>Copyright (c) 2018 Exceptionless. All rights reserved.</Copyright>
1816
<NoWarn>$(NoWarn);CS1591</NoWarn>
1917
<WarningsAsErrors>true</WarningsAsErrors>
2018
<GenerateDocumentationFile>true</GenerateDocumentationFile>

build/sourcelink.props

-9
This file was deleted.

build/version.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- This file may be overwritten by automation. Only values allowed here are VersionPrefix and VersionSuffix. -->
22
<Project>
33
<PropertyGroup>
4-
<VersionPrefix>4.1.0</VersionPrefix>
4+
<VersionPrefix>4.2.0</VersionPrefix>
55
<VersionSuffix>dev</VersionSuffix>
66
</PropertyGroup>
77
</Project>

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "2.0.3"
3+
"version": "2.1.4"
44
}
55
}

src/Exceptionless.Api/Bootstrapper.cs

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using Exceptionless.Core.Models;
1212
using Exceptionless.Core.Models.Data;
1313
using Exceptionless.Core.Queues.Models;
14-
using Exceptionless.Core.Utility;
1514
using Foundatio.Jobs;
1615
using Foundatio.Messaging;
1716
using Microsoft.Extensions.DependencyInjection;
@@ -25,7 +24,6 @@ public static void RegisterServices(IServiceCollection container, ILoggerFactory
2524
container.AddSingleton<WebSocketConnectionManager>();
2625
container.AddSingleton<MessageBusBroker>();
2726
container.AddSingleton<MessageBusBrokerMiddleware>();
28-
container.AddSingleton<IConnectionMapping, ConnectionMapping>();
2927

3028
container.AddSingleton<OverageMiddleware>();
3129
container.AddSingleton<ThrottlingMiddleware>();

src/Exceptionless.Api/Controllers/EventController.cs

+19-14
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,6 @@ public async Task<IActionResult> SetUserDescriptionAsync(string referenceId, [Fr
599599

600600
[HttpPatch("~/api/v1/error/{id:objectid}")]
601601
[ConfigurationResponseFilter]
602-
[ApiExplorerSettings(IgnoreApi = true)]
603602
public async Task<IActionResult> LegacyPatchAsync(string id, [FromBody] Delta<UpdateEvent> changes) {
604603
if (changes == null)
605604
return Ok();
@@ -669,20 +668,20 @@ await Task.WhenAll(
669668
/// <code><![CDATA[/events/submit/log?access_token=YOUR_API_KEY&message=Hello World&source=server01&geo=32.85,-96.9613&randomproperty=true]]></code>
670669
/// </remarks>
671670
/// <param name="projectId">The identifier of the project.</param>
672-
/// <param name="version">The api version that should be used</param>
671+
/// <param name="apiVersion">The api version that should be used</param>
673672
/// <param name="type">The event type</param>
674673
/// <param name="userAgent">The user agent that submitted the event.</param>
675674
/// <param name="parameters">Query String parameters that control what properties are set on the event</param>
676675
/// <response code="200">OK</response>
677676
/// <response code="400">No project id specified and no default project was found.</response>
678677
/// <response code="404">No project was found.</response>
679-
[HttpGet("~/api/v{version:int=2}/events/submit")]
680-
[HttpGet("~/api/v{version:int=2}/events/submit/{type:minlength(1)}")]
681-
[HttpGet("~/api/v{version:int=2}/projects/{projectId:objectid}/events/submit")]
682-
[HttpGet("~/api/v{version:int=2}/projects/{projectId:objectid}/events/submit/{type:minlength(1)}")]
678+
[HttpGet("~/api/v{apiVersion:int=2}/events/submit")]
679+
[HttpGet("~/api/v{apiVersion:int=2}/events/submit/{type:minlength(1)}")]
680+
[HttpGet("~/api/v{apiVersion:int=2}/projects/{projectId:objectid}/events/submit")]
681+
[HttpGet("~/api/v{apiVersion:int=2}/projects/{projectId:objectid}/events/submit/{type:minlength(1)}")]
683682
[ConfigurationResponseFilter]
684683
[SwaggerResponse(StatusCodes.Status200OK)]
685-
public async Task<IActionResult> GetSubmitEventAsync(string projectId = null, int version = 2, string type = null, [UserAgent] string userAgent = null, [QueryStringParameters] IDictionary<string, string[]> parameters = null) {
684+
public async Task<IActionResult> GetSubmitEventAsync(string projectId = null, int apiVersion = 2, string type = null, [UserAgent] string userAgent = null, [QueryStringParameters] IDictionary<string, string[]> parameters = null) {
686685
var filteredParameters = parameters?.Where(p => !String.IsNullOrEmpty(p.Key) && !p.Value.All(String.IsNullOrEmpty) && !_ignoredKeys.Contains(p.Key)).ToList();
687686
if (filteredParameters == null || filteredParameters.Count == 0)
688687
return Ok();
@@ -779,7 +778,7 @@ public async Task<IActionResult> GetSubmitEventAsync(string projectId = null, in
779778

780779
var stream = new MemoryStream(ev.GetBytes(_jsonSerializerSettings));
781780
await _eventPostService.EnqueueAsync(new EventPost {
782-
ApiVersion = version,
781+
ApiVersion = apiVersion,
783782
CharSet = charSet,
784783
ContentEncoding = contentEncoding,
785784
IpAddress = Request.GetClientIpAddress(),
@@ -800,6 +799,13 @@ await _eventPostService.EnqueueAsync(new EventPost {
800799
return Ok();
801800
}
802801

802+
803+
[HttpPost("~/api/v1/error")]
804+
[ConfigurationResponseFilter]
805+
public Task<IActionResult> LegacyPostAsync([UserAgent] string userAgent = null) {
806+
return PostAsync(null, 1, userAgent);
807+
}
808+
803809
/// <summary>
804810
/// Create
805811
/// </summary>
@@ -845,17 +851,16 @@ await _eventPostService.EnqueueAsync(new EventPost {
845851
/// </code>
846852
/// </remarks>
847853
/// <param name="projectId">The identifier of the project.</param>
848-
/// <param name="version">The api version that should be used</param>
854+
/// <param name="apiVersion">The api version that should be used</param>
849855
/// <param name="userAgent">The user agent that submitted the event.</param>
850856
/// <response code="202">Accepted</response>
851857
/// <response code="400">No project id specified and no default project was found.</response>
852858
/// <response code="404">No project was found.</response>
853-
[HttpPost("~/api/v{version:int=1}/error")]
854-
[HttpPost("~/api/v{version:int=2}/events")]
855-
[HttpPost("~/api/v{version:int=2}/projects/{projectId:objectid}/events")]
859+
[HttpPost("~/api/v{apiVersion:int=2}/events")]
860+
[HttpPost("~/api/v{apiVersion:int=2}/projects/{projectId:objectid}/events")]
856861
[ConfigurationResponseFilter]
857862
[SwaggerResponse(StatusCodes.Status202Accepted)]
858-
public async Task <IActionResult> PostAsync(string projectId = null, int version = 2, [UserAgent]string userAgent = null) {
863+
public async Task <IActionResult> PostAsync(string projectId = null, int apiVersion = 2, [UserAgent]string userAgent = null) {
859864
if (Request.ContentLength.HasValue && Request.ContentLength.Value <= 0)
860865
return StatusCode(StatusCodes.Status202Accepted);
861866

@@ -890,7 +895,7 @@ await _eventPostService.EnqueueAsync(new EventPost {
890895
}
891896

892897
await _eventPostService.EnqueueAsync(new EventPost {
893-
ApiVersion = version,
898+
ApiVersion = apiVersion,
894899
CharSet = charSet,
895900
ContentEncoding = Request.Headers.TryGetAndReturn(Headers.ContentEncoding),
896901
IpAddress = Request.GetClientIpAddress(),

src/Exceptionless.Api/Controllers/OrganizationController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ protected override async Task AfterResultMapAsync<TDestination>(ICollection<TDes
696696

697697
var viewOrganizations = models.OfType<ViewOrganization>().ToList();
698698
foreach (var viewOrganization in viewOrganizations) {
699-
DateTime usageRetention = SystemClock.UtcNow.SubtractYears(1).StartOfMonth();
699+
var usageRetention = SystemClock.UtcNow.SubtractYears(1).StartOfMonth();
700700
viewOrganization.Usage = viewOrganization.Usage.Where(u => u.Date > usageRetention).ToList();
701701
viewOrganization.OverageHours = viewOrganization.OverageHours.Where(u => u.Date > usageRetention).ToList();
702702
viewOrganization.IsOverRequestLimit = await OrganizationExtensions.IsOverRequestLimitAsync(viewOrganization.Id, _cacheClient, Settings.Current.ApiThrottleLimit);

src/Exceptionless.Api/Controllers/WebHookController.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ public Task<IActionResult> DeleteAsync(string ids) {
101101
/// This controller action is called by zapier to create a hook subscription.
102102
/// </summary>
103103
[HttpPost("subscribe")]
104-
[HttpPost("~/api/v{version:int=2}/webhooks/subscribe")]
104+
[HttpPost("~/api/v{apiVersion:int=2}/webhooks/subscribe")]
105105
[HttpPost("~/api/v1/projecthook/subscribe")]
106106
[ApiExplorerSettings(IgnoreApi = true)]
107-
public Task<IActionResult> SubscribeAsync([FromBody] JObject data, int version = 1) {
107+
public Task<IActionResult> SubscribeAsync([FromBody] JObject data, int apiVersion = 1) {
108108
var webHook = new NewWebHook {
109109
EventTypes = new[] { data.GetValue("event").Value<string>() },
110110
Url = data.GetValue("target_url").Value<string>(),
111-
Version = new Version(version >= 0 ? version : 0, 0)
111+
Version = new Version(apiVersion >= 0 ? apiVersion : 0, 0)
112112
};
113113

114114
if (!webHook.Url.StartsWith("https://hooks.zapier.com"))

src/Exceptionless.Api/Exceptionless.Api.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageReference Include="Exceptionless.AspNetCore.Signed" Version="4.2.1982" />
9-
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
9+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
1010
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.1.0" />
1111
<PackageReference Include="OAuth2" Version="0.9.12-pre" />
1212
</ItemGroup>

src/Exceptionless.Api/Extensions/HttpExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static string GetDefaultOrganizationId(this HttpRequest request) {
8484
}
8585

8686
public static string GetDefaultProjectId(this HttpRequest request) {
87-
// TODO: Use project id from url. E.G., /api/v{version:int=2}/projects/{projectId:objectid}/events
87+
// TODO: Use project id from url. E.G., /api/v{apiVersion:int=2}/projects/{projectId:objectid}/events
8888
//var path = request.Path.Value;
8989

9090
var principal = request.GetClaimsPrincipal();

0 commit comments

Comments
 (0)