public void Handle(TraceChangingEvent message) { _traceMessage = new StatusBarMessage(ActiveDocument, "Waiting for trace to update"); _traceStatus = message.TraceStatus; NotifyOfPropertyChange(() => CanRunQuery); NotifyOfPropertyChange(() => CanConnect); }
public void OnTraceStarted() { _status = QueryTraceStatus.Started; if (TraceStarted != null) { TraceStarted(this, null); } }
public void Handle(TraceChangedEvent message) { if (_traceMessage != null) { _traceMessage.Dispose(); } _traceStatus = message.TraceStatus; NotifyOfPropertyChange(() => CanRunQuery); NotifyOfPropertyChange(() => CanConnect); }
public void Handle(ActivateDocumentEvent message) { Log.Debug("{Class} {Event} {Document}", "RibbonViewModel", "Handle:ActivateDocumentEvent", message.Document.DisplayName); _isDocumentActivating = true; ActiveDocument = message.Document; var doc = ActiveDocument; SelectedTarget = ActiveDocument.SelectedTarget; _queryRunning = ActiveDocument.IsQueryRunning; if (ActiveDocument.Tracer == null) { _traceStatus = QueryTraceStatus.Stopped; } else { _traceStatus = ActiveDocument.Tracer.Status; } NotifyOfPropertyChange(() => CanRunQuery); NotifyOfPropertyChange(() => CanCancelQuery); NotifyOfPropertyChange(() => CanClearCache); NotifyOfPropertyChange(() => CanRefreshMetadata); NotifyOfPropertyChange(() => CanConnect); if (!ActiveDocument.IsConnected) { UpdateTraceWatchers(); NotifyOfPropertyChange(() => TraceWatchers); NotifyOfPropertyChange(() => ServerTimingsChecked); NotifyOfPropertyChange(() => ServerTimingDetails); return; } try { RefreshConnectionDetails(ActiveDocument, ActiveDocument.SelectedDatabase); // TODO - do we still need to check trace watchers if we are not connected?? UpdateTraceWatchers(); } catch (AdomdConnectionException ex) { Log.Error("{class} {method} {Exception}", "RibbonViewModel", "Handle(ActivateDocumentEvent)", ex); doc.OutputError(ex.Message); } finally { _isDocumentActivating = false; } NotifyOfPropertyChange(() => TraceWatchers); NotifyOfPropertyChange(() => ServerTimingsChecked); NotifyOfPropertyChange(() => ServerTimingDetails); }
public TraceChangingEvent(QueryTraceStatus traceStatus) { TraceStatus = traceStatus; }
public void Stop() { _status = QueryTraceStatus.Stopping; queryTraceHubProxy.Invoke("Stop").Wait(3000); // TODO - do we need to timeout or force here if app is closing _status = QueryTraceStatus.Stopped; }
private void OnTraceEventInternal(object sender, TraceEventArgs e) { // we are using CommandBegin as a "heartbeat" to check if the trace // has started capturing events if (!_traceStarted) { StopTimer(); _traceStarted = true; Status = QueryTraceStatus.Started; if (TraceStarted != null) TraceStarted(this, new TraceStartedEventArgs()); } else { OnTraceEvent(e); if (e.EventClass == TraceEventClass.QueryEnd) { //Stop(); if (TraceCompleted != null) TraceCompleted(this, null); } } }
public void Stop() { Status = QueryTraceStatus.Stopping; if (_trace != null) { _trace.OnEvent -= OnTraceEventInternal; try { // _trace.Stop(); _trace.Drop(); _trace = null; Status = QueryTraceStatus.Stopped; } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e); } } _traceStarted = false; }
//private IResultsTarget _resultsTarget; public void Start() { if (_trace != null) if (_trace.IsStarted) throw new InvalidOperationException("Cannot start a new trace as one is already running"); if (Status != QueryTraceStatus.Started) Status = QueryTraceStatus.Starting; _trace = GetTrace(); SetupTrace(_trace); _trace.Start(); // create timer to "ping" the server with DISCOVER_SESSION requests // until the trace events start to fire. if (_startingTimer == null) _startingTimer = new Timer(); _startingTimer.Interval = 300; //TODO - make time interval shorter _startingTimer.Elapsed += OnTimerElapsed; _startingTimer.Enabled = true; _startingTimer.Start(); utcPingStart = DateTime.UtcNow; // Wait for Trace to become active }
//public void Clear() //{ // _trace.Events.Clear(); //} public void Start() { if (_trace != null) if (_trace.IsStarted || Status == QueryTraceStatus.Starting ) return; // if the trace is already running exit here if (Status != QueryTraceStatus.Started) Status = QueryTraceStatus.Starting; _connection = new ADOTabular.ADOTabularConnection(_connectionString, _connectionType); _connection.Open(); _trace = GetTrace(); SetupTrace(_trace, _eventsToCapture); _trace.Start(); // create timer to "ping" the server with DISCOVER_SESSION requests // until the trace events start to fire. if (_startingTimer == null) _startingTimer = new Timer(); _startingTimer.Interval = 300; //TODO - make time interval shorter? _startingTimer.Elapsed += OnTimerElapsed; _startingTimer.Enabled = true; _startingTimer.Start(); utcPingStart = DateTime.UtcNow; // Wait for Trace to become active }
private void OnTraceEventInternal(object sender, xlAmo.TraceEventArgs e) { // we are using CommandBegin as a "heartbeat" to check if the trace // has started capturing events if (!_traceStarted) { StopTimer(); _traceStarted = true; Status = QueryTraceStatus.Started; if (TraceStarted != null) TraceStarted(this, null); } else { //OnTraceEvent(e); _capturedEvents.Add( CreateTraceEventArg(e)); if (e.EventClass == xlAmo.TraceEventClass.QueryEnd) { // Raise an event with the captured events if (TraceCompleted != null) TraceCompleted(this, _capturedEvents); // reset the captured events collection _capturedEvents = new List<DaxStudioTraceEventArgs>(); } } }
public TraceChangedEvent(QueryTraceStatus traceStatus) { TraceStatus = traceStatus; }
public void Stop() { _status = QueryTraceStatus.Stopping; queryTraceHubProxy.Invoke("Stop").Wait(); _status = QueryTraceStatus.Stopped; }
private void OnTraceEventInternal(object sender, TraceEventArgs e) { // we are using CommandBegin as a "heartbeat" to check if the trace // has started capturing events if (!_traceStarted) { StopTimer(); _traceStarted = true; Status = QueryTraceStatus.Started; if (TraceStarted != null) TraceStarted(this, null); } else { System.Diagnostics.Debug.Print("TraceEvent: {0}", e.EventClass.ToString()); OnTraceEvent(e); _capturedEvents.Add(new DaxStudioTraceEventArgs(e)); if (e.EventClass == TraceEventClass.QueryEnd) { // Raise an event with the captured events if (TraceCompleted != null) TraceCompleted(this, _capturedEvents); // reset the captured events collection _capturedEvents = new List<DaxStudioTraceEventArgs>(); } } }
public void Start() { try { if (_trace != null) if (_trace.IsStarted || Status == QueryTraceStatus.Starting) return; // exit here if trace is already started if (Status != QueryTraceStatus.Started) Status = QueryTraceStatus.Starting; Log.Verbose("{class} {method} {event}", "QueryTraceEngine", "Start", "Connecting to: " + _connectionString); _connection = new ADOTabular.ADOTabularConnection(_connectionString, _connectionType); _connection.Open(); _trace = GetTrace(); SetupTrace(_trace, _eventsToCapture); _trace.Start(); // create timer to "ping" the server with DISCOVER_SESSION requests // until the trace events start to fire. if (_startingTimer == null) _startingTimer = new Timer(); _startingTimer.Interval = 300; //TODO - make time interval shorter? _startingTimer.Elapsed += OnTimerElapsed; _startingTimer.Enabled = true; _startingTimer.Start(); utcPingStart = DateTime.UtcNow; // Wait for Trace to become active } catch (Exception ex) { Log.Error("{class} {method} {message}","QueryTraceEngine" , "Start", ex.Message); } }