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

Diagnostics: Adds request session token #3176

Merged
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ public void RecordResponse(
storeResult,
request.ResourceType,
request.OperationType,
request.RequestContext.SessionToken,
imanvt marked this conversation as resolved.
Show resolved Hide resolved
locationEndpoint);

lock (this.storeResponseStatistics)
Expand Down Expand Up @@ -441,13 +442,15 @@ public StoreResponseStatistics(
StoreResult storeResult,
ResourceType resourceType,
OperationType operationType,
ISessionToken sessionToken,
Uri locationEndpoint)
{
this.RequestStartTime = requestStartTime;
this.RequestResponseTime = requestResponseTime;
this.StoreResult = storeResult;
this.RequestResourceType = resourceType;
this.RequestOperationType = operationType;
this.RequestSessionToken = sessionToken;
imanvt marked this conversation as resolved.
Show resolved Hide resolved
this.LocationEndpoint = locationEndpoint;
this.IsSupplementalResponse = operationType == OperationType.Head || operationType == OperationType.HeadFeed;
}
Expand All @@ -457,6 +460,7 @@ public StoreResponseStatistics(
public StoreResult StoreResult { get; }
public ResourceType RequestResourceType { get; }
public OperationType RequestOperationType { get; }
public ISessionToken RequestSessionToken { get; }
public Uri LocationEndpoint { get; }
public bool IsSupplementalResponse { get; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()),
ResourceType.Document,
OperationType.Query,
new SimpleSessionToken(42),
uri1.Uri);

TraceWriterBaselineTests.GetPrivateField<List<StoreResponseStatistics>>(datum, "storeResponseStatistics").Add(storeResponseStatistics);
Expand Down Expand Up @@ -463,6 +464,7 @@
transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()),
resourceType: default,
operationType: default,
sessionToken: default,
imanvt marked this conversation as resolved.
Show resolved Hide resolved
locationEndpoint: default);

TraceWriterBaselineTests.GetPrivateField<List<StoreResponseStatistics>>(datum, "storeResponseStatistics").Add(storeResponseStatistics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void ValidateStoreResultSerialization()
storeResult,
ResourceType.Document,
OperationType.Query,
new SimpleSessionToken(42),
new Uri("http://someUri1.com"));

((List<StoreResponseStatistics>)datum.GetType().GetField("storeResponseStatistics", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(datum)).Add(storeResponseStatistics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ public void TraceData()
transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()),
ResourceType.Document,
OperationType.Query,
new SimpleSessionToken(42),
uri1.Uri);

TraceWriterBaselineTests.GetPrivateField<List<StoreResponseStatistics>>(datum, "storeResponseStatistics").Add(storeResponseStatistics);
Expand Down Expand Up @@ -437,6 +438,7 @@ public void TraceData()
transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()),
resourceType: default,
operationType: default,
sessionToken: default,
locationEndpoint: default);

TraceWriterBaselineTests.GetPrivateField<List<StoreResponseStatistics>>(datum, "storeResponseStatistics").Add(storeResponseStatistics);
Expand Down