public static HtmlString CurrentRequestSessions() { var httpContextWrapper = new HttpContextWrapper(HttpContext.Current); var root = UrlHelper.GenerateContentUrl("~/ravendb/profiling", httpContextWrapper); var script = UrlHelper.GenerateContentUrl("~/ravendb/profiling?path=ravendb-profiler-scripts.js", httpContextWrapper); var yepnope = UrlHelper.GenerateContentUrl("~/ravendb/profiling?path=yepnope.js", httpContextWrapper); var jquery = UrlHelper.GenerateContentUrl("~/ravendb/profiling?path=jquery-1.6.1.min.js", httpContextWrapper); var jquerytmpl = UrlHelper.GenerateContentUrl("~/ravendb/profiling?path=jquery.tmpl.min.js", httpContextWrapper); const string template = @" <script type=""text/javascript"" src=""{3}""></script> <script type=""text/javascript""> yepnope([{{ test: window.jQuery, nope: '{4}' }}, {{ test: window.jQuery && window.jQuery.fn.tmpl, nope: '{5}' }}, {{load: '{1}', complete: function() {{ jQuery(function() {{ RavenDBProfiler.initalize({{ id:[{0}], url: '{2}' }}); }} ); }} }}]); </script>"; var ids = string.Join(",", ContextualSessionList.Select(guid => "'" + guid + "'")); return(new HtmlString(string.Format(template, ids, script, root, yepnope, jquery, jquerytmpl))); }
private static void TrackSession(InMemoryDocumentSessionOperations session) { GlimpseTimer.Moment("Session Created", GlimpseTimerCategory); ContextualSessionList.Add(session.Id); }