This repository has been archived by the owner on Jan 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More refacotring of types & namespaces
- Loading branch information
1 parent
80d6953
commit 7b5cf60
Showing
25 changed files
with
79 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/Glimpse.Agent.Core/Internal/Messaging/DefaultMessagePayloadFormatter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using Glimpse.Agent.AspNet.Messages; | ||
using Glimpse.Agent.Inspectors; | ||
using Microsoft.AspNet.Http; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Glimpse.Agent | ||
{ | ||
public abstract class Tab : Inspector | ||
{ | ||
public override void Before(HttpContext context) | ||
{ | ||
if (TabExecuteWhen == TabExecute.BeforeResponse) | ||
Publish(context); | ||
} | ||
|
||
public override void After(HttpContext context) | ||
{ | ||
if (TabExecuteWhen == TabExecute.AfterResponse) | ||
Publish(context); | ||
} | ||
|
||
private void Publish(HttpContext context) | ||
{ | ||
object data = null; | ||
try | ||
{ | ||
data = GetData(context); | ||
} | ||
catch (Exception exception) | ||
{ | ||
data = exception; | ||
} | ||
|
||
var broker = context.RequestServices.GetService<IAgentBroker>(); | ||
|
||
broker.SendMessage(new TabMessage(Name, data)); | ||
} | ||
|
||
public virtual TabExecute TabExecuteWhen => TabExecute.AfterResponse; | ||
|
||
public abstract string Name { get; } | ||
|
||
public abstract object GetData(HttpContext context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Glimpse.Agent | ||
{ | ||
public enum TabExecute | ||
{ | ||
BeforeResponse, | ||
AfterResponse | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...nitialization/IResourceOptionsProvider.cs → ...Configuration/IResourceOptionsProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...ization/OptionsResourceOptionsProvider.cs → ...uration/OptionsResourceOptionsProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...on.Core/Initialization/ResourceOptions.cs → ...mon.Core/Configuration/ResourceOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Glimpse.Initialization | ||
namespace Glimpse.Configuration | ||
{ | ||
public class ResourceOptions | ||
{ | ||
|
3 changes: 1 addition & 2 deletions
3
src/Glimpse.Common.Core/DependencyInjection/GlimpseCoreServiceCollectionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Glimpse.Common.Core/Internal/Serialization/DefaultJsonSerializerProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Glimpse.Common.Core/Internal/Serialization/GuidConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Glimpse.Common.Core/Internal/Serialization/IJsonSerializerProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
src/Glimpse.Common.Core/Internal/Serialization/StringValuesConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Glimpse.Common.Core/Internal/Serialization/TimeSpanConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/Glimpse.Common.Core/Platform/DefaultGlimpseContextAccessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
using System; | ||
using Glimpse.Common; | ||
|
||
namespace Glimpse.Platform | ||
{ | ||
|
1 change: 1 addition & 0 deletions
1
src/Glimpse.Server.Core/Configuration/DefaultResourceOptionsProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/Glimpse.Server.Core/DependencyInjection/ServerRegisterServices.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/Glimpse.Server.Core/Internal/Resources/ExportConfigurationResource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters