Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
73b375b7
Commit
73b375b7
authored
Jul 27, 2018
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#466 Added diagnostic timer
parent
6ab646f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
SessionEventArgsBase.cs
Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs
+7
-0
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+6
-0
ResponseHandler.cs
Titanium.Web.Proxy/ResponseHandler.cs
+4
-1
No files found.
Titanium.Web.Proxy/EventArguments/SessionEventArgsBase.cs
View file @
73b375b7
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Net
;
using
System.Net
;
using
System.Threading
;
using
System.Threading
;
using
StreamExtended
;
using
StreamExtended
;
...
@@ -25,6 +26,11 @@ namespace Titanium.Web.Proxy.EventArguments
...
@@ -25,6 +26,11 @@ namespace Titanium.Web.Proxy.EventArguments
protected
readonly
IBufferPool
bufferPool
;
protected
readonly
IBufferPool
bufferPool
;
protected
readonly
ExceptionHandler
exceptionFunc
;
protected
readonly
ExceptionHandler
exceptionFunc
;
/// <summary>
/// Relative milliseconds for various events.
/// </summary>
public
Dictionary
<
string
,
DateTime
>
TimeLine
{
get
;
set
;
}
=
new
Dictionary
<
string
,
DateTime
>();
/// <summary>
/// <summary>
/// Initializes a new instance of the <see cref="SessionEventArgsBase" /> class.
/// Initializes a new instance of the <see cref="SessionEventArgsBase" /> class.
/// </summary>
/// </summary>
...
@@ -34,6 +40,7 @@ namespace Titanium.Web.Proxy.EventArguments
...
@@ -34,6 +40,7 @@ namespace Titanium.Web.Proxy.EventArguments
bufferSize
=
server
.
BufferSize
;
bufferSize
=
server
.
BufferSize
;
bufferPool
=
server
.
BufferPool
;
bufferPool
=
server
.
BufferPool
;
exceptionFunc
=
server
.
ExceptionFunc
;
exceptionFunc
=
server
.
ExceptionFunc
;
TimeLine
.
Add
(
"Session Created"
,
DateTime
.
Now
);
}
}
protected
SessionEventArgsBase
(
ProxyServer
server
,
ProxyEndPoint
endPoint
,
protected
SessionEventArgsBase
(
ProxyServer
server
,
ProxyEndPoint
endPoint
,
...
...
Titanium.Web.Proxy/RequestHandler.cs
View file @
73b375b7
...
@@ -165,6 +165,8 @@ namespace Titanium.Web.Proxy
...
@@ -165,6 +165,8 @@ namespace Titanium.Web.Proxy
//we need this to syphon out data from connection if API user changes them.
//we need this to syphon out data from connection if API user changes them.
request
.
SetOriginalHeaders
();
request
.
SetOriginalHeaders
();
args
.
TimeLine
.
Add
(
"Request Received"
,
DateTime
.
Now
);
// If user requested interception do it
// If user requested interception do it
await
invokeBeforeRequest
(
args
);
await
invokeBeforeRequest
(
args
);
...
@@ -213,6 +215,8 @@ namespace Titanium.Web.Proxy
...
@@ -213,6 +215,8 @@ namespace Titanium.Web.Proxy
//for connection pool, retry fails until cache is exhausted.
//for connection pool, retry fails until cache is exhausted.
var
result
=
await
retryPolicy
<
ServerConnectionException
>().
ExecuteAsync
(
async
(
serverConnection
)
=>
var
result
=
await
retryPolicy
<
ServerConnectionException
>().
ExecuteAsync
(
async
(
serverConnection
)
=>
{
{
args
.
TimeLine
.
Add
(
"Server Connection Created"
,
DateTime
.
Now
);
// if upgrading to websocket then relay the request without reading the contents
// if upgrading to websocket then relay the request without reading the contents
if
(
request
.
UpgradeToWebSocket
)
if
(
request
.
UpgradeToWebSocket
)
{
{
...
@@ -378,6 +382,8 @@ namespace Titanium.Web.Proxy
...
@@ -378,6 +382,8 @@ namespace Titanium.Web.Proxy
{
{
await
handleHttpSessionResponse
(
args
);
await
handleHttpSessionResponse
(
args
);
}
}
args
.
TimeLine
.
Add
(
"Response Sent"
,
DateTime
.
Now
);
}
}
/// <summary>
/// <summary>
...
...
Titanium.Web.Proxy/ResponseHandler.cs
View file @
73b375b7
using
System.Net
;
using
System
;
using
System.Net
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Titanium.Web.Proxy.EventArguments
;
using
Titanium.Web.Proxy.EventArguments
;
using
Titanium.Web.Proxy.Extensions
;
using
Titanium.Web.Proxy.Extensions
;
...
@@ -23,6 +24,8 @@ namespace Titanium.Web.Proxy
...
@@ -23,6 +24,8 @@ namespace Titanium.Web.Proxy
// read response & headers from server
// read response & headers from server
await
args
.
WebSession
.
ReceiveResponse
(
cancellationToken
);
await
args
.
WebSession
.
ReceiveResponse
(
cancellationToken
);
args
.
TimeLine
.
Add
(
"Response Received"
,
DateTime
.
Now
);
var
response
=
args
.
WebSession
.
Response
;
var
response
=
args
.
WebSession
.
Response
;
args
.
ReRequest
=
false
;
args
.
ReRequest
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment