/// <summary> /// Adds the profiling results fro the <paramref name="response"/> to the supplied <paramref name="profiler"/>. /// </summary> /// <param name="response">The response from a request.</param> /// <param name="profiler">The profiler to add the results to.</param> /// <param name="newStartMilliseconds">The start time used to update the remote timings.</param> internal static HttpResponseMessage AddRemoteProfilerResults(HttpResponseMessage response, MiniProfiler profiler, decimal newStartMilliseconds) { // Get the serialized results header. IEnumerable<string> miniProfilerResults; if (!response.Headers.TryGetValues(MiniProfilerHandler.ResultsHeaderName, out miniProfilerResults)) return response; // Get the data. string resultsHeader = miniProfilerResults.First(); MiniProfiler remoteProfiler = ProfilerExtensions.Deserialize(resultsHeader); // Update the timings of the remote profiler results. remoteProfiler.Root.UpdateStartMillisecondTimingsToAbsolute(newStartMilliseconds); profiler.AddProfilerResults(remoteProfiler); return response; }