Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a5cb4f2
feat(instrumentation): add recording of Tab Morph
Julesboul Feb 6, 2026
9ecc3d8
fix(instrumentation): fix morph table instrumentation
Julesboul Feb 6, 2026
16609b8
test(instrumentation): fix tests by including tab changes
Julesboul Feb 9, 2026
febf360
fix(instrumentation): record morph tab only when selected
Julesboul Feb 9, 2026
63eafd5
fix(instrumentation): record the componant when tab change
Julesboul Feb 10, 2026
76a67a7
fix: recording sender and implementors windows
Julesboul Feb 11, 2026
f1230a2
refactor: change instrumentation of TabMorph to capture all changes i…
Julesboul Feb 11, 2026
c71a8ec
feat(instrumentation): capture scrolling events
Julesboul Feb 19, 2026
15728d9
feat(instrumentation): add recording of Tab Morph
Julesboul Feb 6, 2026
6a01b3f
test(instrumentation): fix tests by including tab changes
Julesboul Feb 9, 2026
877f4cc
fix(instrumentation): record morph tab only when selected
Julesboul Feb 9, 2026
7901231
fix(instrumentation): record the componant when tab change
Julesboul Feb 10, 2026
5699945
refactor: change instrumentation of TabMorph to capture all changes i…
Julesboul Feb 11, 2026
c307937
feat(instrumentation): capture scrolling events
Julesboul Feb 19, 2026
e0fb6e3
fix(records): add windowId recording when needed
Julesboul Mar 25, 2026
7f10b21
fix(TabMorph): record the correct windowId
Julesboul Apr 1, 2026
e3c7c65
fix(tests) tests on senders instrumentation
Julesboul Apr 1, 2026
bbbc7eb
feat(history): add an API to get scrolling periods
Julesboul Apr 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions DebuggingSpy-Tests/DSRecordHistoryTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,55 @@ DSRecordHistoryTest >> testBuildWindows [
self assert: (windows at: 8) first name equals: 'StDebugger'.
]

{ #category : 'tests' }
DSRecordHistoryTest >> testCollectScrollingPeriods [

| scrollList |
history records: {
(DSMouseEnterWindowRecord new
dateTime: '2026-03-25T10:01:17' asDateAndTime;
windowId: 1).
(DSScrollingRecord new
dateTime: '2026-03-25T10:02:44' asDateAndTime;
windowId: 1).
(DSScrollingRecord new
dateTime: '2026-03-25T10:06:08' asDateAndTime;
windowId: 1).
(DSScrollingRecord new
dateTime: '2026-03-25T10:09:23' asDateAndTime;
windowId: 1).
(DSScrollingRecord new
dateTime: '2026-03-25T10:13:41' asDateAndTime;
windowId: 1).
(DSMouseLeaveWindowRecord new
dateTime: '2026-03-25T10:20:16' asDateAndTime;
windowId: 1).
(DSMouseEnterWindowRecord new
dateTime: '2026-03-25T10:21:41' asDateAndTime;
windowId: 2).
(DSDoItRecord new
dateTime: '2026-03-25T10:26:09' asDateAndTime;
windowId: 2).
(DSScrollingRecord new
dateTime: '2026-03-25T10:13:41' asDateAndTime;
windowId: 2).
(DSStepIntoRecord new
dateTime: '2026-03-25T10:14:01' asDateAndTime;
windowId: 2) }.

scrollList := history collectScrollingPeriods.

self assert: scrollList size equals: 2.
self assert: scrollList first key equals: {
'2026-03-25T10:02:44' asDateAndTime.
'2026-03-25T10:13:41' asDateAndTime }.
self assert: scrollList first value equals: 1.
self assert: scrollList second key equals: {
'2026-03-25T10:13:41' asDateAndTime.
'2026-03-25T10:13:41' asDateAndTime }.
self assert: scrollList second value equals: 2
]

{ #category : 'tests' }
DSRecordHistoryTest >> testCollectTimeDiscrepancies [

Expand Down Expand Up @@ -638,6 +687,56 @@ DSRecordHistoryTest >> testFixWindowRecordKeysNames [
self assert: (windowsHistory keys detect: [ :k | k windowId = 2 ]) windowName isNil
]

{ #category : 'tests' }
DSRecordHistoryTest >> testGetSumOfScrollingPeriods [

| scrollList |
history records: {
(DSMouseEnterWindowRecord new
dateTime: '2026-03-25T10:01:17' asDateAndTime;
windowId: 1).
(DSScrollingRecord new
dateTime: '2026-03-25T10:02:44' asDateAndTime;
windowId: 1).
(DSScrollingRecord new
dateTime: '2026-03-25T10:06:08' asDateAndTime;
windowId: 1).
(DSScrollingRecord new
dateTime: '2026-03-25T10:09:23' asDateAndTime;
windowId: 1).
(DSScrollingRecord new
dateTime: '2026-03-25T10:13:41' asDateAndTime;
windowId: 1).
(DSMouseLeaveWindowRecord new
dateTime: '2026-03-25T10:20:16' asDateAndTime;
windowId: 1).
(DSMouseEnterWindowRecord new
dateTime: '2026-03-25T10:21:41' asDateAndTime;
windowId: 2).
(DSDoItRecord new
dateTime: '2026-03-25T10:26:09' asDateAndTime;
windowId: 2).
(DSScrollingRecord new
dateTime: '2026-03-25T10:13:41' asDateAndTime;
windowId: 2).
(DSStepIntoRecord new
dateTime: '2026-03-25T10:14:01' asDateAndTime;
windowId: 2).
(DSScrollingRecord new
dateTime: '2026-03-25T10:26:35' asDateAndTime;
windowId: 1).
(DSScrollingRecord new
dateTime: '2026-03-25T10:27:39' asDateAndTime;
windowId: 1) }.


scrollList := history getSumOfScrollingPeriods.

self assert: scrollList size equals: 2.
self assert: (scrollList at: 1) equals: (Duration seconds: 721).
self assert: (scrollList at: 2) equals: (Duration seconds: 0)
]

{ #category : 'tests' }
DSRecordHistoryTest >> testMergeContinuousEvents [

Expand Down
6 changes: 3 additions & 3 deletions DebuggingSpy-Tests/DSSpyInstrumenterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ DSSpyInstrumenterTest >> testInstrumentSpCodeBrowse [
codePresenter rawSelection: (1 to: 4).
browseCommand execute.

self assert: self registry size equals: 2.
self assert: self registry size equals: 4.
record := self registry first.

self assert: record class identicalTo: DSBrowseRecord.
Expand Down Expand Up @@ -840,7 +840,7 @@ DSSpyInstrumenterTest >> testInstrumentSpCodeImplementors [
record := self registry first.
self assert: record class identicalTo: DSImplementorsRecord.
self assert: record windowId equals: codePresenter window identityHash.

record := self registry second.
self assert: record class identicalTo: DSWindowOpenedRecord
]
Expand Down Expand Up @@ -895,7 +895,7 @@ DSSpyInstrumenterTest >> testInstrumentSpCodeSenders [
record := self registry first.
self assert: record class identicalTo: DSSendersRecord.
self assert: record windowId equals: codePresenter window identityHash.

record := self registry second.
self assert: record class identicalTo: DSWindowOpenedRecord
]
Expand Down
7 changes: 7 additions & 0 deletions DebuggingSpy/ClyShowMessageImplementorCommand.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'ClyShowMessageImplementorCommand' }

{ #category : '*DebuggingSpy' }
ClyShowMessageImplementorCommand >> recordWindow [

^ browser
]
7 changes: 7 additions & 0 deletions DebuggingSpy/ClyShowMessageSenderCommand.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'ClyShowMessageSenderCommand' }

{ #category : '*DebuggingSpy' }
ClyShowMessageSenderCommand >> recordWindow [

^ browser
]
3 changes: 2 additions & 1 deletion DebuggingSpy/DSAbstractHaltRecord.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ DSAbstractHaltRecord >> method: aMethod [
DSAbstractHaltRecord >> record: anRBProgramNode [

method := anRBProgramNode methodNode compiledMethod name.
sourceCodeInterval := anRBProgramNode start to: anRBProgramNode stop
sourceCodeInterval := anRBProgramNode start to: anRBProgramNode stop.
super record: anRBProgramNode
]

{ #category : 'accessing' }
Expand Down
5 changes: 3 additions & 2 deletions DebuggingSpy/DSCodeActionRecord.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ DSCodeActionRecord >> record: anEditor [

selectedString := DSSpy recordSourceCode
ifTrue: [ anEditor recordSelectedString ]
ifFalse: [
DSSpy recordSourceCodeDisabledErrorMessage ]
ifFalse: [ DSSpy recordSourceCodeDisabledErrorMessage ].

super record: anEditor
]

{ #category : 'accessing' }
Expand Down
40 changes: 40 additions & 0 deletions DebuggingSpy/DSMorphTabRecord.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"
I am recording the MorphTab in which the user is.
"
Class {
#name : 'DSMorphTabRecord',
#superclass : 'DSAbstractEventRecord',
#instVars : [
'tabName'
],
#category : 'DebuggingSpy-Records',
#package : 'DebuggingSpy',
#tag : 'Records'
}

{ #category : 'instance creation' }
DSMorphTabRecord class >> for: anObject [

| rec |
rec := self new record: anObject.
rec ifNotNil: [ DSRecordRegistry current addRecord: rec ].
^ rec
]

{ #category : 'accessing' }
DSMorphTabRecord >> eventName [

^ 'Changing in tab'
]

{ #category : 'actions api' }
DSMorphTabRecord >> record: aTabGroupMorph [

| tabTool |
tabTool := aTabGroupMorph submorphs first submorphs.
tabTool isEmpty ifTrue: [ ^ nil ].

tabName := tabTool first asString.

super record: aTabGroupMorph window
]
39 changes: 39 additions & 0 deletions DebuggingSpy/DSRecordHistory.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,30 @@ DSRecordHistory >> buildWindows [
((w respondsTo: #type) and: [ #( 'Finish' 'Post-task' 'Survey' ) includes: w type ]) or: [ w windowId = -1 ] ] ]
]

{ #category : 'API-history' }
DSRecordHistory >> collectScrollingPeriods [

| i scrollingPeriods |
i := 1.
scrollingPeriods := OrderedCollection new.

[ i <= records size ] whileTrue: [
(records at: i) class = DSScrollingRecord ifTrue: [
| start stop |
start := (records at: i) dateTime.
stop := (records at: i) dateTime.
i := i + 1.
[ i <= records size and: [ (records at: i) class = DSScrollingRecord ] ] whileTrue: [
stop := (records at: i) dateTime.
i := i + 1 ].
scrollingPeriods add: {
start.
stop } -> (records at: i - 1) windowId ].
i := i + 1 ].

^ scrollingPeriods
]

{ #category : 'private - history' }
DSRecordHistory >> collectTimeDiscrepancies [
"Returns a dictionary which contains all delta between two records above than 5s"
Expand Down Expand Up @@ -339,6 +363,21 @@ DSRecordHistory >> fixWindowRecordKeysNames [
(self findWindowRecordKeyForID: id) windowName: name ]
]

{ #category : 'API-history' }
DSRecordHistory >> getSumOfScrollingPeriods [

| scrollingPeriods |
scrollingPeriods := self collectScrollingPeriods.
scrollingPeriods := scrollingPeriods collect: [ :association |
association key second - association key first -> association value ].

scrollingPeriods := scrollingPeriods groupedBy: [ :association | association value ].

scrollingPeriods := scrollingPeriods collect: [ :array | array collect: [ :association | association key ] ].

^ scrollingPeriods collect: [ :value | value sum ]
]

{ #category : 'API-history' }
DSRecordHistory >> haltAnalysisMap [

Expand Down
25 changes: 25 additions & 0 deletions DebuggingSpy/DSScrollingRecord.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"
I am recording events linked to scrolling.
"
Class {
#name : 'DSScrollingRecord',
#superclass : 'DSAbstractEventRecord',
#instVars : [
'toolName'
],
#category : 'DebuggingSpy-Records',
#package : 'DebuggingSpy',
#tag : 'Records'
}

{ #category : 'accessing' }
DSScrollingRecord >> eventName [
^ 'Scrolling'
]

{ #category : 'actions api' }
DSScrollingRecord >> record: aMorph [

toolName := aMorph asString.
super record: aMorph window
]
27 changes: 26 additions & 1 deletion DebuggingSpy/DSSpyInstrumenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ DSSpyInstrumenter >> instrumentPrintIt [
SpCodePrintItCommand link: DSPrintItRecord link toAST: (SpCodePrintItCommand >> #execute) ast
]

{ #category : 'interactions' }
DSSpyInstrumenter >> instrumentScrolling [
"Instruments the scrolling in different components"

Morph link: DSScrollingRecord link toAST: (Morph >> #mouseWheel:) ast.
SliderMorph link: DSScrollingRecord link toAST: (SliderMorph >> #dragging:) ast.
GeneralScrollPaneMorph link: DSScrollingRecord link toAST: (GeneralScrollPaneMorph >> #mouseWheel:) ast
]

{ #category : 'system' }
DSSpyInstrumenter >> instrumentSendersActions [
"Instruments actions to show senders of a method or class"
Expand Down Expand Up @@ -187,11 +196,19 @@ DSSpyInstrumenter >> instrumentSystem [
self logCodeInteractions.
self logBrowsingActions.
self logDebuggerActions.
self logClyBrowserActions.

"Intruments exceptions"
self instrumentExceptionSignalling
]

{ #category : 'interactions' }
DSSpyInstrumenter >> instrumentTabMorph [
"Instruments the active Tab Morph"

TabGroupMorph link: DSMorphTabRecord link toAST: (TabGroupMorph >> #update:with:) ast
]

{ #category : 'debugpoints' }
DSSpyInstrumenter >> listenToDebugPointChanges [
"Listen to the announcements link to debugPoints modification and record the event"
Expand Down Expand Up @@ -237,6 +254,13 @@ DSSpyInstrumenter >> logClipboardActions [
self instrumentPaste
]

{ #category : 'system-instrumentation' }
DSSpyInstrumenter >> logClyBrowserActions [
"Instrument actions link to the Browser UI : scrolling, change in tabs, ..."

self instrumentTabMorph
]

{ #category : 'system-instrumentation' }
DSSpyInstrumenter >> logCodeInteractions [
"Instruments actions linked to code execution : do it, print it, inspect it, ..."
Expand All @@ -261,7 +285,8 @@ DSSpyInstrumenter >> logMouseEvents [
"Instrument mouse events"

self instrumentMouseEnterWindow.
self instrumentMouseLeaveWindow
self instrumentMouseLeaveWindow.
self instrumentScrolling
]

{ #category : 'system-instrumentation' }
Expand Down
14 changes: 2 additions & 12 deletions DebuggingSpy/DSWindowEventRecord.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,11 @@ Class {
DSWindowEventRecord >> record: aWindowEvent [

| tool |
self recordWindowIdFromEvent: aWindowEvent.
self windowId: aWindowEvent window identityHash.
self recordWindowNameFromEvent: aWindowEvent.
tool := DSSpy toolInWindow: aWindowEvent window.
tool ifNil: [ ^ self ].
toolInfo := DSToolInfo
toolNamed: tool class name
id: tool identityHash
windowId: windowId
]

{ #category : 'recording' }
DSWindowEventRecord >> recordWindowIdFromEvent: anEvent [
|win|
win := anEvent window.
windowId := win identityHash
toolInfo := DSToolInfo toolNamed: tool class name id: tool identityHash windowId: windowId
]

{ #category : 'recording' }
Expand Down