public static extern Result GetEventProfilingInformation( [In] IntPtr eventHandle, [In][MarshalAs(UnmanagedType.U4)] ProfilingInformation parameterName, [In] UIntPtr parameterValueSize, [Out] byte[] parameterValue, [Out] out UIntPtr parameterValueSizeReturned );
///<summary> /// Create a new instance ///</summary> public EmbeddedDatabaseCommands(DocumentDatabase database, DocumentConvention convention, Guid?sessionId) { profilingInformation = ProfilingInformation.CreateProfilingInformation(sessionId); this.database = database; this.convention = convention; OperationsHeaders = new NameValueCollection(); }
public EnableProfiling() { using (var documentStore = new DocumentStore()) { #region initialize_profiling documentStore.InitializeProfiling(); #endregion Guid id = Guid.Empty; #region get_profiling_info ProfilingInformation profilingInformation = documentStore.GetProfilingInformationFor(id); #endregion #region example Guid sesionId; using (IDocumentSession session = documentStore.OpenSession()) { sesionId = ((DocumentSession)session).Id; session.Load <Employee>("employees/1"); } ProfilingInformation sessionProfilingInfo = documentStore.GetProfilingInformationFor(sesionId); #endregion } }
public override void GetData(object target, System.IO.Stream outgoingData) { var session = (DocumentSession)target; var profilingInformation = ((DocumentStore)session.DocumentStore).GetProfilingInformationFor(session.Id) ?? ProfilingInformation.CreateProfilingInformation(session.Id); new BinaryFormatter().Serialize(outgoingData, profilingInformation); }
/// <summary> /// Initializes a new instance of the <see cref="AsyncServerClient"/> class. /// </summary> public AsyncServerClient(string url, DocumentConvention convention, ICredentials credentials, HttpJsonRequestFactory jsonRequestFactory, Guid?sessionId) { profilingInformation = ProfilingInformation.CreateProfilingInformation(sessionId); this.url = url.EndsWith("/") ? url.Substring(0, url.Length - 1) : url; this.convention = convention; this.credentials = credentials; this.jsonRequestFactory = jsonRequestFactory; this.sessionId = sessionId; }
public ProfilingInformation Filter(ProfilingInformation information) { var profilingInformation = ProfilingInformation.CreateProfilingInformation(information.Id); profilingInformation.At = information.At; profilingInformation.Context = information.Context; profilingInformation.DurationMilliseconds = information.DurationMilliseconds; profilingInformation.Requests = information.Requests.Select(FilterRequest).ToList(); return(profilingInformation); }
///<summary> /// Create a new instance ///</summary> public EmbeddedDatabaseCommands(DocumentDatabase database, DocumentConvention convention, Guid?sessionId) { profilingInformation = ProfilingInformation.CreateProfilingInformation(sessionId); this.database = database; this.convention = convention; OperationsHeaders = new NameValueCollection(); if (database.Configuration.IsSystemDatabase() == false) { throw new InvalidOperationException("Database must be a system database"); } }
/// <summary> /// Initializes the class /// </summary> /// <param name="logTarget">The target action to be called at end of profiling</param> /// <param name="tag">A user defined tag that uniquely identifies a block being profiled</param> /// <param name="silent">Set this to true to ensure that the profiling results are not report.</param> /// <param name="lineNumber">Compiler supplied line number. Do not provide this value yourself</param> /// <param name="filename">Compiler supplied filename. Do not provide this value yourself</param> public ProfilerService(Expression <Action <ProfilingInformation> > logTarget, string tag, bool silent, [CallerLineNumber] int lineNumber = 0, [CallerFilePath] string filename = "") { _profilingInfo = new ProfilingInformation { Tag = tag, Silent = silent, Filename = filename, LineNumber = lineNumber }; _logTarget = logTarget; _stopWatch = new Stopwatch(); _stopWatch.Start(); }
/// <summary> /// Initializes a new instance of the <see cref="AsyncServerClient"/> class. /// </summary> public AsyncServerClient(string url, DocumentConvention convention, ICredentials credentials, HttpJsonRequestFactory jsonRequestFactory, Guid?sessionId, Task veryFirstRequest) { profilingInformation = ProfilingInformation.CreateProfilingInformation(sessionId); this.url = url.EndsWith("/") ? url.Substring(0, url.Length - 1) : url; this.convention = convention; this.credentials = credentials; this.jsonRequestFactory = jsonRequestFactory; this.sessionId = sessionId; this.veryFirstRequest = veryFirstRequest; jsonRequestFactory.ConfigureRequest += (sender, args) => { args.JsonRequest.WaitForTask = veryFirstRequest; }; }
/// <summary> /// Initializes a new instance of the <see cref="AsyncServerClient"/> class. /// </summary> public AsyncServerClient(string url, DocumentConvention convention, ICredentials credentials, HttpJsonRequestFactory jsonRequestFactory, Guid?sessionId) { profilingInformation = ProfilingInformation.CreateProfilingInformation(sessionId); this.url = url.EndsWith("/") ? url.Substring(0, url.Length - 1) : url; this.convention = convention; this.credentials = credentials; this.jsonRequestFactory = jsonRequestFactory; this.sessionId = sessionId; // required to ensure just a single auth dialog Task task = jsonRequestFactory.CreateHttpJsonRequest(this, (url + "/docs?pageSize=0").NoCache(), "GET", credentials, convention) .ReadResponseStringAsync(); jsonRequestFactory.ConfigureRequest += (sender, args) => { args.JsonRequest.WaitForTask = task; }; }
private static void ProfilingInformationOnOnContextCreated(ProfilingInformation profilingInformation) { if (RecordCurrentControllerContextFilter.CurrentControllerContext == null) { return; } var routeData = RecordCurrentControllerContextFilter.CurrentControllerContext.RequestContext.RouteData; if (routeData == null) { return; } foreach (var value in routeData.Values) { profilingInformation.Context[value.Key] = (value.Value ?? "null").ToString(); } }