private void Connections_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { switch (e.Action) { case NotifyCollectionChangedAction.Add: foreach (CommandConnection item in e.NewItems) { switch (item.Type) { case CommandConnectionType.Opened: { if (item.ConnectionId == null) { continue; } if (isConnectionDataPointAdded(item)) { continue; } AddDataPoint(item.ApplicationIdentity, item.ConnectionId.Value, 0); PluginContext.NotifyPluginsHost(NotificationType.Update, 1); CallbacksManagerBase.UpdateAppIdentityNotificationsCount(item); } break; } } break; } }
private void Command_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { switch (e.Action) { case NotifyCollectionChangedAction.Add: foreach (Command item in e.NewItems) { var xValue = item.HttpInfo.HttpContextCurrentId; if (xValue == null) { continue; } var pointInfo = FindDataPointInfo(item.ApplicationIdentity, xValue.Value); if (pointInfo.Index == -1) { AddDataPoint(item.ApplicationIdentity, xValue.Value, 1); PluginContext.NotifyPluginsHost(NotificationType.Update, 1); CallbacksManagerBase.UpdateAppIdentityNotificationsCount(item); } else { var newY = pointInfo.Point.Y + 1; pointInfo.LineSeries.Points[pointInfo.Index] = new DataPoint(pointInfo.Point.X, newY); UpdateYMax(newY); } HaveNewPoints = true; } break; } }
public ChartsViewModelBase(ProfilerPluginBase pluginContext) : base(pluginContext) { if (Designer.IsInDesignModeStatic) return; CallbacksManagerBase = new CallbacksManagerBase(PluginContext, GuiModelData); GuiModelData.PropertyChanged += GuiModelData_PropertyChanged; CustomTooltipProvider = new CustomTooltipProvider { GetCustomTooltip = GetCustomTooltip }; }
public MainViewModel(ProfilerPluginBase pluginContext) : base(pluginContext) { if (Designer.IsInDesignModeStatic) return; setActions(); setGuiModel(); _callbacksManager = new CallbacksManagerBase(PluginContext, GuiModelData); setEvenets(); }
protected override void ShowNearestSelectedPointCommands(AppIdentity identity, LineSeries lineSeries, OxyMouseDownEventArgs args) { GuiModelData.SelectedApplicationIdentity = identity; var indexOfNearestPoint = (int)Math.Round(args.HitTestResult.Index); var point = lineSeries.Points[indexOfNearestPoint]; var connectionId = (int)point.X; CallbacksManagerBase.ShowAllCommandsWithSameConnectionId(connectionId); SelectedPointInfo = GetSelectedPointInfo(lineSeries, point); }
public MainViewModel(ProfilerPluginBase pluginContext) : base(pluginContext) { if (Designer.IsInDesignModeStatic) { return; } setActions(); setGuiModel(); _callbacksManager = new CallbacksManagerBase(PluginContext, GuiModelData); setEvenets(); }
public ChartsViewModelBase(ProfilerPluginBase pluginContext) : base(pluginContext) { if (Designer.IsInDesignModeStatic) { return; } CallbacksManagerBase = new CallbacksManagerBase(PluginContext, GuiModelData); GuiModelData.PropertyChanged += GuiModelData_PropertyChanged; CustomTooltipProvider = new CustomTooltipProvider { GetCustomTooltip = GetCustomTooltip }; }
private void CommandResults_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { switch (e.Action) { case NotifyCollectionChangedAction.Add: foreach (CommandResult item in e.NewItems) { if (item.CommandId != null && item.RowsReturned != null) { AddDataPoint(item.ApplicationIdentity, item.CommandId.Value, item.RowsReturned.Value); PluginContext.NotifyPluginsHost(NotificationType.Update, 1); CallbacksManagerBase.UpdateAppIdentityNotificationsCount(item); } } break; } }
private void showCommands(int requestId) { if (GuiModelData.SelectedApplicationIdentity == null) { return; } GuiModelData.RelatedCommands.Clear(); GuiModelData.RelatedStackTraces.Clear(); var commands = PluginContext.ProfilerData.Commands .Where(command => command.HttpInfo.HttpContextCurrentId == requestId && command.ApplicationIdentity.Equals(GuiModelData.SelectedApplicationIdentity)) .OrderBy(command => command.AtDateTime) .ToList(); GuiModelData.RelatedCommands = new ObservableCollection <Command>(commands); CallbacksManagerBase.ActivateRelatedStackTraces(); }
private void Results_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { switch (e.Action) { case NotifyCollectionChangedAction.Add: foreach (CommandResult item in e.NewItems) { if (item.CommandId == null) { continue; } var command = PluginContext.ProfilerData.Commands .FirstOrDefault(x => x.CommandId == item.CommandId && x.ApplicationIdentity.Equals(item.ApplicationIdentity)); if (command == null) { continue; } if (command.CommandCpuUsage == null) { command.CommandCpuUsage = item.AppDomainSnapshot.TotalProcessorTime - command.AppDomainSnapshot.TotalProcessorTime; } AddDataPoint(item.ApplicationIdentity, item.CommandId.Value, command.CommandCpuUsage.Value); PluginContext.NotifyPluginsHost(NotificationType.Update, 1); CallbacksManagerBase.UpdateAppIdentityNotificationsCount(item); } break; } }