Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorJeffrey Stedfast <jestedfa@microsoft.com>2020-01-06 22:26:51 +0300
committerGitHub <noreply@github.com>2020-01-06 22:26:51 +0300
commit88626b9fbf44e915446b42a9a4d627d74f97e969 (patch)
tree95d7f5a11ebf1b007acfc015ee9db227efeb5440 /main/src
parentb497d87444826ef6b02499978b560a9abee5a2b8 (diff)
parentaa670be277cdfc3c0c040b4f80ed587cccafe1b2 (diff)
Merge pull request #9456 from mono/jstedfast-debugger-stepping-telemetry
[Debugger] Added telemetry for stepping and Locals/Watch/CallStack/To…
Diffstat (limited to 'main/src')
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchView.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/QuickInfo/DebuggerQuickInfoSource.cs23
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/QuickInfo/MacDebuggerTooltipWindow.cs1
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Counters.cs20
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs68
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs1
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs33
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacDebuggerObjectNameView.cs10
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacDebuggerTextField.cs10
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacObjectValueTreeView.cs30
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueStackFrame.cs5
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs1
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs13
13 files changed, 163 insertions, 54 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchView.cs
index 3736f36d95..5c937d32c7 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchView.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/PinnedWatches/PinnedWatchView.cs
@@ -57,7 +57,7 @@ namespace MonoDevelop.Debugger.VSTextView.PinnedWatches
controller.AllowExpanding = false;
treeView = controller.GetMacControl (ObjectValueTreeViewFlags.PinnedWatchFlags);
-
+ treeView.UIElementName = "PinnedWatch";
controller.PinnedWatch = watch;
if (watch.Value != null)
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/QuickInfo/DebuggerQuickInfoSource.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/QuickInfo/DebuggerQuickInfoSource.cs
index 8835fe7e30..05ba944d75 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/QuickInfo/DebuggerQuickInfoSource.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/QuickInfo/DebuggerQuickInfoSource.cs
@@ -7,7 +7,7 @@ using Gtk;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
-
+using Mono.Debugging.Client;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Documents;
@@ -119,22 +119,27 @@ namespace MonoDevelop.Debugger.VSTextView.QuickInfo
return null;
}
- private async Task EvaluateAndShowTooltipAsync (IAsyncQuickInfoSession session, ITextView view, SnapshotPoint point, DataTipInfo debugInfo, CancellationToken cancellationToken)
+ async Task EvaluateAndShowTooltipAsync (IAsyncQuickInfoSession session, ITextView view, SnapshotPoint point, DataTipInfo debugInfo, CancellationToken cancellationToken)
{
var options = DebuggingService.DebuggerSession.EvaluationOptions.Clone ();
options.AllowMethodEvaluation = true;
options.AllowTargetInvoke = true;
+ ObjectValue val;
- var val = DebuggingService.CurrentFrame.GetExpressionValue (debugInfo.Text, options);
+ using (var timer = DebuggingService.CurrentFrame.DebuggerSession.TooltipStats.StartTimer ()) {
+ val = DebuggingService.CurrentFrame.GetExpressionValue (debugInfo.Text, options);
- if (val.IsEvaluating)
- await WaitOneAsync (val.WaitHandle, cancellationToken);
+ if (val.IsEvaluating)
+ await WaitOneAsync (val.WaitHandle, cancellationToken);
- if (cancellationToken.IsCancellationRequested)
- return;
+ if (cancellationToken.IsCancellationRequested)
+ return;
- if (val == null || val.IsUnknown || val.IsNotSupported)
- return;
+ if (val == null || val.IsUnknown || val.IsNotSupported)
+ return;
+
+ timer.Success = true;
+ }
if (!view.Properties.TryGetProperty (typeof (Widget), out Widget gtkParent))
return;
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/QuickInfo/MacDebuggerTooltipWindow.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/QuickInfo/MacDebuggerTooltipWindow.cs
index de0d95a703..c0d228350e 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/QuickInfo/MacDebuggerTooltipWindow.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.VSTextView/QuickInfo/MacDebuggerTooltipWindow.cs
@@ -53,6 +53,7 @@ namespace MonoDevelop.Debugger
controller.PinnedWatchLocation = location;
treeView = controller.GetMacControl (ObjectValueTreeViewFlags.TooltipFlags);
+ treeView.UIElementName = "Tooltip";
treeView.NodePinned += OnPinStatusChanged;
treeView.StartEditing += OnStartEditing;
treeView.EndEditing += OnEndEditing;
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Counters.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Counters.cs
index c8fd7030f7..c72f154692 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Counters.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Counters.cs
@@ -24,18 +24,36 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using MonoDevelop.Core.Instrumentation;
using System;
+using MonoDevelop.Core.Instrumentation;
+
namespace MonoDevelop.Debugger
{
static class Counters
{
public static Counter DebugSession = InstrumentationService.CreateCounter ("Debug Session", "Debugger", id: "Debugger.DebugSession");
public static Counter EvaluationStats = InstrumentationService.CreateCounter ("Evaluation Statistics", "Debugger", id: "Debugger.EvaluationStatistics");
+ public static Counter StepInStats = InstrumentationService.CreateCounter ("Step In Statistics", "Debugger", id: "Debugger.StepInStatistics");
+ public static Counter StepOutStats = InstrumentationService.CreateCounter ("Step Out Statistics", "Debugger", id: "Debugger.StepOutStatistics");
+ public static Counter StepOverStats = InstrumentationService.CreateCounter ("Step Over Statistics", "Debugger", id: "Debugger.StepOverStatistics");
+ public static Counter StepInstructionStats = InstrumentationService.CreateCounter ("Step Instruction Statistics", "Debugger", id: "Debugger.StepInstructionStatistics");
+ public static Counter NextInstructionStats = InstrumentationService.CreateCounter ("Next Instruction Statistics", "Debugger", id: "Debugger.NextInstructionStatistics");
public static TimerCounter<DebuggerStartMetadata> DebuggerStart = InstrumentationService.CreateTimerCounter<DebuggerStartMetadata> ("Debugger Start", "Debugger", id: "Debugger.Start");
public static TimerCounter<DebuggerActionMetadata> DebuggerAction = InstrumentationService.CreateTimerCounter<DebuggerActionMetadata> ("Debugger Action", "Debugger", id: "Debugger.Action");
+ public static Counter LocalVariableStats = InstrumentationService.CreateCounter ("Local Variable Statistics", "Debugger", id: "Debugger.LocalVariableStatistics");
+ public static Counter WatchExpressionStats = InstrumentationService.CreateCounter ("Watch Expression Statistics", "Debugger", id: "Debugger.WatchExpressionStatistics");
+ public static Counter StackTraceStats = InstrumentationService.CreateCounter ("Stack Trace Statistics", "Debugger", id: "Debugger.StackTraceStatistics");
+ public static Counter TooltipStats = InstrumentationService.CreateCounter ("Tooltip Statistics", "Debugger", id: "Debugger.TooltipStatistics");
public static Counter DebuggerBusy = InstrumentationService.CreateCounter ("Debugger Busy", "Debugger", id: "Debugger.Busy");
+ public static Counter LocalsPadFrameChanged = InstrumentationService.CreateCounter ("The StackFrame changed in the Locals Pad", "Debugger", id: "Debugger.LocalsPadFrameChanged");
+ public static Counter AddedWatchFromLocals = InstrumentationService.CreateCounter ("Added a Watch Expression from the Locals Pad", "Debugger", id: "Debugger.AddedWatchFromLocals");
+ public static Counter ManuallyAddedWatch = InstrumentationService.CreateCounter ("User Manually Added Watch Expression", "Debugger", id: "Debugger.ManuallyAddedWatch");
+ public static Counter PinnedWatch = InstrumentationService.CreateCounter ("Pinned Watch Expression", "Debugger", id: "Debugger.PinnedWatch");
+ public static Counter EditedValue = InstrumentationService.CreateCounter ("User Edited Variable Value", "Debugger", id: "Debugger.EditedValue");
+ public static Counter ExpandedNode = InstrumentationService.CreateCounter ("User Expanded ObjectValue Node", "Debugger", id: "Debugger.ExpandedObjectValueNode");
+ public static Counter OpenedPreviewer = InstrumentationService.CreateCounter ("User opened the value in the previewer", "Debugger", id: "Debugger.OpenedPreviewer");
+ public static Counter OpenedVisualizer = InstrumentationService.CreateCounter ("User opened the value in a Visualizer", "Debugger", id: "Debugger.OpenedVisualizer");
}
class DebuggerStartMetadata : CounterMetadata
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
index 18b9c9a50a..4775b05ce5 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
@@ -27,31 +27,31 @@
//
using System;
-using System.Collections.Generic;
using System.Xml;
+using System.Linq;
+using System.Threading;
+using System.Globalization;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Collections.Concurrent;
+
using Mono.Addins;
+
using Mono.Debugging.Client;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
+
+using Microsoft.VisualStudio.Text;
+using Microsoft.CodeAnalysis.Text;
+
using MonoDevelop.Ide;
+using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Projects;
-using MonoDevelop.Debugger.Viewers;
-
-/*
- * Some places we should be doing some error handling we used to toss
- * exceptions, now we error out silently, this needs a real solution.
- */
+using MonoDevelop.Components;
+using MonoDevelop.Core.Execution;
using MonoDevelop.Ide.TextEditing;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Collections.Concurrent;
-using System.Threading;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Debugger.Viewers;
using MonoDevelop.Core.Instrumentation;
-using MonoDevelop.Components;
-using Microsoft.VisualStudio.Text;
-using Microsoft.CodeAnalysis.Text;
namespace MonoDevelop.Debugger
{
@@ -135,7 +135,6 @@ namespace MonoDevelop.Debugger
args.Cancel = true;
}
-
public static IExecutionHandler GetExecutionHandler ()
{
return executionHandlerFactory;
@@ -145,7 +144,6 @@ namespace MonoDevelop.Debugger
get { return currentSession?.Session ?? sessions.Values.FirstOrDefault ()?.Session; }
}
-
public static DebuggerSession [] GetSessions ()
{
return sessions.Keys.ToArray ();
@@ -815,7 +813,19 @@ namespace MonoDevelop.Debugger
public void Dispose ()
{
UpdateDebugSessionCounter ();
- UpdateEvaluationStatsCounter ();
+
+ UpdateStatsCounter (Counters.EvaluationStats, Session.EvaluationStats);
+
+ UpdateStatsCounter (Counters.StepInStats, Session.StepInStats);
+ UpdateStatsCounter (Counters.StepOutStats, Session.StepOutStats);
+ UpdateStatsCounter (Counters.StepOverStats, Session.StepOverStats);
+ UpdateStatsCounter (Counters.StepInstructionStats, Session.StepInstructionStats);
+ UpdateStatsCounter (Counters.NextInstructionStats, Session.NextInstructionStats);
+
+ UpdateStatsCounter (Counters.LocalVariableStats, Session.LocalVariableStats);
+ UpdateStatsCounter (Counters.WatchExpressionStats, Session.WatchExpressionStats);
+ UpdateStatsCounter (Counters.StackTraceStats, Session.StackTraceStats);
+ UpdateStatsCounter (Counters.TooltipStats, Session.TooltipStats);
console?.Dispose ();
console = null;
@@ -844,7 +854,7 @@ namespace MonoDevelop.Debugger
void UpdateDebugSessionCounter ()
{
var metadata = new Dictionary<string, object> ();
- metadata ["Success"] = (!SessionError).ToString ();
+ metadata ["Success"] = (!SessionError).ToString (CultureInfo.InvariantCulture);
metadata ["DebuggerType"] = Engine.Id;
if (firstAssemblyLoadTimer != null) {
@@ -852,29 +862,25 @@ namespace MonoDevelop.Debugger
// No first assembly load event.
firstAssemblyLoadTimer.Stop ();
} else {
- metadata ["AssemblyFirstLoadDuration"] = firstAssemblyLoadTimer.ElapsedMilliseconds.ToString ();
+ metadata ["AssemblyFirstLoadDuration"] = firstAssemblyLoadTimer.ElapsedMilliseconds.ToString (CultureInfo.InvariantCulture);
}
}
Counters.DebugSession.Inc (1, null, metadata);
}
- void UpdateEvaluationStatsCounter ()
+ void UpdateStatsCounter (Counter counter, DebuggerStatistics stats)
{
- if (Session.EvaluationStats.TimingsCount == 0 && Session.EvaluationStats.FailureCount == 0) {
+ if (stats.TimingsCount == 0 && stats.FailureCount == 0) {
// No timings or failures recorded.
return;
}
var metadata = new Dictionary<string, object> ();
- metadata ["DebuggerType"] = Engine.Id;
- metadata ["AverageDuration"] = Session.EvaluationStats.AverageTime.ToString ();
- metadata ["MaximumDuration"] = Session.EvaluationStats.MaxTime.ToString ();
- metadata ["MinimumDuration"] = Session.EvaluationStats.MinTime.ToString ();
- metadata ["FailureCount"] = Session.EvaluationStats.FailureCount.ToString ();
- metadata ["SuccessCount"] = Session.EvaluationStats.TimingsCount.ToString ();
+ metadata["DebuggerType"] = Engine.Id;
+ stats.Serialize (metadata);
- Counters.EvaluationStats.Inc (1, null, metadata);
+ counter.Inc (1, null, metadata);
}
bool ExceptionHandler (Exception ex)
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
index 619354ebb9..442b86ee3f 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
@@ -194,6 +194,7 @@ widget ""*.exception_help_link_label"" style ""exception-help-link-label""
if (Platform.IsMac) {
macExceptionValueTreeView = controller.GetMacControl (ObjectValueTreeViewFlags.ObjectValuePadFlags);
+ macExceptionValueTreeView.UIElementName = "ExceptionCaughtDialog";
} else {
exceptionValueTreeView = controller.GetGtkControl (ObjectValueTreeViewFlags.ExceptionCaughtFlags);
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs
index 97cf84202a..e64938f183 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs
@@ -26,6 +26,7 @@
//
using System;
+using System.Collections.Generic;
using Mono.Debugging.Client;
@@ -67,7 +68,7 @@ namespace MonoDevelop.Debugger
void AddFakeNodes ()
{
- var xx = new System.Collections.Generic.List<ObjectValueNode> ();
+ var xx = new List<ObjectValueNode> ();
xx.Add (new FakeObjectValueNode ("f1"));
xx.Add (new FakeIsImplicitNotSupportedObjectValueNode ());
@@ -84,14 +85,35 @@ namespace MonoDevelop.Debugger
controller.AddValues (xx);
}
- void ReloadValues ()
+ void ReloadValues (bool frameChanged)
{
var frame = DebuggingService.CurrentFrame;
if (frame == null)
return;
- var locals = frame.GetAllLocals ();
+ ObjectValue[] locals;
+ TimeSpan elapsed;
+
+ using (var timer = frame.DebuggerSession.LocalVariableStats.StartTimer ()) {
+ try {
+ locals = frame.GetAllLocals ();
+ timer.Stop (true);
+ } catch {
+ locals = new ObjectValue[0];
+ timer.Stop (false);
+ }
+
+ elapsed = timer.Elapsed;
+ }
+
+ if (frameChanged) {
+ var metadata = new Dictionary<string, object> ();
+ metadata["LocalsCount"] = locals.Length;
+ metadata["Elapsed"] = elapsed.TotalMilliseconds;
+
+ Counters.LocalsPadFrameChanged.Inc (1, null, metadata);
+ }
DebuggerLoggingService.LogMessage ("Begin Local Variables:");
foreach (var local in locals)
@@ -107,7 +129,6 @@ namespace MonoDevelop.Debugger
_treeview.EndUpdates ();
}
-
if (EnableFakeNodes)
AddFakeNodes ();
} else {
@@ -119,13 +140,13 @@ namespace MonoDevelop.Debugger
public override void OnUpdateFrame ()
{
base.OnUpdateFrame ();
- ReloadValues ();
+ ReloadValues (true);
}
public override void OnUpdateValues ()
{
base.OnUpdateValues ();
- ReloadValues ();
+ ReloadValues (false);
}
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacDebuggerObjectNameView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacDebuggerObjectNameView.cs
index 63b1c60e32..a48fbd8a48 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacDebuggerObjectNameView.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacDebuggerObjectNameView.cs
@@ -182,8 +182,10 @@ namespace MonoDevelop.Debugger
UpdateContents ();
if (Node is AddNewExpressionObjectValueNode) {
- if (newValue.Length > 0)
+ if (newValue.Length > 0) {
TreeView.OnExpressionAdded (newValue);
+ Counters.ManuallyAddedWatch.Inc (1);
+ }
} else if (newValue != oldValue) {
TreeView.OnExpressionEdited (Node, newValue);
}
@@ -429,6 +431,12 @@ namespace MonoDevelop.Debugger
SetPreviewButtonIcon (PreviewButtonIcon.Active);
DebuggingService.ShowPreviewVisualizer (val, IdeApp.Workbench.RootWindow, buttonArea);
+
+ var metadata = new Dictionary<string, object> ();
+ metadata["UIElementName"] = TreeView.UIElementName;
+ metadata["ObjectValue.Type"] = val.TypeName;
+
+ Counters.OpenedPreviewer.Inc (1, null, metadata);
}
void OnEditorLostFocus (object sender, EventArgs e)
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacDebuggerTextField.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacDebuggerTextField.cs
index 704469aac8..fd95fd209d 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacDebuggerTextField.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacDebuggerTextField.cs
@@ -24,6 +24,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+using System.Collections.Generic;
+
using AppKit;
using Foundation;
@@ -103,8 +105,14 @@ namespace MonoDevelop.Debugger
cellView.TreeView.OnExpressionEdited (cellView.Node, newValue);
}
} else if (cellView is MacDebuggerObjectValueView) {
- if (newValue != oldValue && cellView.TreeView.GetEditValue (cellView.Node, newValue))
+ if (newValue != oldValue && cellView.TreeView.GetEditValue (cellView.Node, newValue)) {
+ var metadata = new Dictionary<string, object> ();
+ metadata["UIElementName"] = cellView.TreeView.UIElementName;
+ metadata["ObjectValue.Type"] = cellView.Node.TypeName;
+
+ Counters.EditedValue.Inc (1, null, metadata);
cellView.Refresh ();
+ }
}
oldValue = newValue = null;
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacObjectValueTreeView.cs
index 0f2909acc9..fa11d2a3f4 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacObjectValueTreeView.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Mac/MacObjectValueTreeView.cs
@@ -143,6 +143,10 @@ namespace MonoDevelop.Debugger
"bounds", NSNull.Null);
}
+ public string UIElementName {
+ get; set;
+ }
+
public ObjectValueTreeViewController Controller {
get; private set;
}
@@ -451,6 +455,8 @@ namespace MonoDevelop.Debugger
}
NodePinned?.Invoke (this, new ObjectValueNodeEventArgs (node));
+
+ Counters.PinnedWatch.Inc (1);
}
public void Pin (ObjectValueNode node)
@@ -475,6 +481,12 @@ namespace MonoDevelop.Debugger
internal bool ShowVisualizer (ObjectValueNode node)
{
+ var metadata = new Dictionary<string, object> ();
+ metadata["UIElementName"] = UIElementName;
+ metadata["ObjectValue.Type"] = node.TypeName;
+
+ Counters.OpenedVisualizer.Inc (1, null, metadata);
+
var args = new ObjectValueNodeEventArgs (node);
NodeShowVisualiser?.Invoke (this, args);
return args.Response is bool b && b;
@@ -563,6 +575,19 @@ namespace MonoDevelop.Debugger
// TODO: all this scrolling kind of seems awkward
//if (path != null)
// ScrollToCell (path, expCol, true, 0f, 0f);
+
+ var parent = node.Parent;
+ int level = 0;
+ while (parent != null) {
+ parent = parent.Parent;
+ level++;
+ }
+
+ var metadata = new Dictionary<string, object> ();
+ metadata["UIElementName"] = UIElementName;
+ metadata["NodeLevel"] = level;
+
+ Counters.ExpandedNode.Inc (1, null, metadata);
}
}
@@ -883,6 +908,11 @@ namespace MonoDevelop.Debugger
foreach (var expression in expressions)
DebuggingService.AddWatch (expression);
+
+ var metadata = new Dictionary<string, object> ();
+ metadata["ExpressionCount"] = expressions.Count;
+
+ Counters.AddedWatchFromLocals.Inc (1, null, metadata);
}
void OnAddWatch (object sender, EventArgs args)
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueStackFrame.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueStackFrame.cs
index 7e8880ab22..938cb925ae 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueStackFrame.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueStackFrame.cs
@@ -80,7 +80,10 @@ namespace MonoDevelop.Debugger
ObjectValue[] qvalues;
if (StackFrame != null) {
- qvalues = StackFrame.GetExpressionValues (unknown.ToArray (), true);
+ using (var timer = StackFrame.DebuggerSession.WatchExpressionStats.StartTimer ()) {
+ qvalues = StackFrame.GetExpressionValues (unknown.ToArray (), true);
+ timer.Success = true;
+ }
} else {
qvalues = new ObjectValue[unknown.Count];
for (int i = 0; i < qvalues.Length; i++)
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs
index bb964bd8bb..7751d5e230 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs
@@ -71,6 +71,7 @@ namespace MonoDevelop.Debugger
if (Platform.IsMac) {
LoggingService.LogInfo ("Using MacObjectValueTreeView for {0}", allowWatchExpressions ? "Watch Pad" : "Locals Pad");
var treeView = controller.GetMacControl (ObjectValueTreeViewFlags.ObjectValuePadFlags);
+ treeView.UIElementName = allowWatchExpressions ? "WatchPad" : "LocalsPad";
_treeview = treeView;
fontChanger = new PadFontChanger (treeView, treeView.SetCustomFont, treeView.QueueResize);
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
index f2f694f3db..1923ca3b5f 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
@@ -222,10 +222,17 @@ namespace MonoDevelop.Debugger
{
var backtrace = DebuggingService.CurrentCallStack;
var result = new List<(StackFrame frame, string text)> ();
- for (int i = 0; i < backtrace.FrameCount; i++) {
- var frame = backtrace.GetFrame (i);
- result.Add ((frame, frame.FullStackframeText));
+
+ if (backtrace.FrameCount > 0) {
+ using (var timer = backtrace.DebuggerSession.StackTraceStats.StartTimer ()) {
+ for (int i = 0; i < backtrace.FrameCount; i++) {
+ var frame = backtrace.GetFrame (i);
+ result.Add ((frame, frame.FullStackframeText));
+ }
+ timer.Success = true;
+ }
}
+
return result;
}