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

request response metrics #270

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion Gigya.Microdot.ServiceProxy/ServiceProxyProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,14 @@ private async Task<object> InvokeCore(HttpServiceRequest request, Type resultRet
clientCallEvent.RequestStartTimestamp = Stopwatch.GetTimestamp();
try
{
response = await GetHttpClient(config).PostAsync(uri, httpContent).ConfigureAwait(false);
HttpClient cli = GetHttpClient(config);

response = await cli.PostAsync(uri, httpContent).ConfigureAwait(false);

responseContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);

clientCallEvent.clientCallSize = requestContent.Length;
clientCallEvent.clientResponseSize = (responseContent != null ? responseContent.Length : 0);
}
finally
{
Expand Down
9 changes: 9 additions & 0 deletions Gigya.Microdot.SharedLogic/Events/ClientCallEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,14 @@ public class ClientCallEvent : Event
[EventField(EventConsts.statsNetworkTime, OmitFromAudit = true)]
public double? NetworkTimeMS => TotalTimeMS - ServerTimeMs;

[EventField(EventConsts.numDocumentsRead)]
public int? numDocumentsRead { get; set; }

[EventField(EventConsts.clientCallSize)]
public int? clientCallSize { get; set; }

[EventField(EventConsts.clientResponseSize)]
public int? clientResponseSize { get; set; }

}
}
4 changes: 4 additions & 0 deletions Gigya.Microdot.SharedLogic/Events/EventConsts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public static class EventConsts
public const string runtimeDC = "runtime.dc";
public const string runtimeENV = "runtime.env";

public const string numDocumentsRead = "numDocumentsRead";
public const string clientCallSize = "clientCallSize";
public const string clientResponseSize = "clientResponseSize";

public const string siteID = "siteID";
public const string apikey = "apikey";
public const string partnerID = "partnerID";
Expand Down