Skip to content

Commit

Permalink
Class comments and extract method refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanmontt committed Jun 18, 2024
1 parent d54be77 commit 942244c
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/IllimaniProfiler/GCActivityMonitor.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
I am a garbage collector monitor that register the garbage collector activity. To see how often I register the GC activity, see the method `defaultWaitingTime`.
"
Class {
#name : 'GCActivityMonitor',
#superclass : 'Object',
Expand All @@ -12,6 +15,12 @@ Class {
#tag : 'GC-Monitor'
}

{ #category : 'initialization' }
GCActivityMonitor >> defaultWaitingTime [

^ 1 second
]

{ #category : 'exporting' }
GCActivityMonitor >> exportData: baseFileName [

Expand All @@ -30,7 +39,7 @@ GCActivityMonitor >> initialize [
super initialize.
fullGCs := OrderedCollection new: 10000.
scavenges := OrderedCollection new: 10000.
waitingTime := 1 second
waitingTime := self defaultWaitingTime
]

{ #category : 'api' }
Expand Down
3 changes: 3 additions & 0 deletions src/IllimaniProfiler/IllAbstractExporter.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
I am the abstract class for the exporters. What I do is basically provide logic for exporting the profiling data as json and csv files.
"
Class {
#name : 'IllAbstractExporter',
#superclass : 'Object',
Expand Down
10 changes: 9 additions & 1 deletion src/IllimaniProfiler/IllAbstractProfiler.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
"
I am the abstract class that proviedes infrastructure for all the profilers. You can subclass me to craft your own custom profiler.
I am the abstract class that proviedes infrastructure for all the profilers. You can subclass me to craft your own custom profiler. You can see my subclasses as examples of custom profilers.
- Sampling rate: I have a default sampling rate for capturing the allocations, so I do not capture the 100% of allocations by default.
- Exporting: I can export my data in form of json and csv. I can export the metadata and the raw allocations.
- GUI: I also provide a GUI that the users can use to navigate my data. But, I can be fully used without the GUI too.
- GC logger: I also provide a garbage collector logger that logs the GC activity one per second and then exports the data. By default, the logger is a null object, so it doesn't log anything by default.
- VM statistics and statistics in general
- Announcement when the profiling has stopped: I make an announcement when the profiler has finished profiling.
"
Class {
#name : 'IllAbstractProfiler',
Expand Down
3 changes: 3 additions & 0 deletions src/IllimaniProfiler/IllAllocationRateProfiler.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
I am an allocation rate profiler. What I do is to only *count* the number of allocated objects by inscreasing a counter. Nothing more.
"
Class {
#name : 'IllAllocationRateProfiler',
#superclass : 'IllAbstractProfiler',
Expand Down
3 changes: 3 additions & 0 deletions src/IllimaniProfiler/IllHandler.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
I am a handler that is in charge to delegate the instrumentation actions to the profiler. For more info, read the MethodProxies documentation: [https://github.com/pharo-contributions/MethodProxies](https://github.com/pharo-contributions/MethodProxies)
"
Class {
#name : 'IllHandler',
#superclass : 'MpHandler',
Expand Down
3 changes: 3 additions & 0 deletions src/IllimaniProfiler/IllInstrumentator.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
I am an object that is used to instrument the allocator method. I only serve for instrumenting and uninstrumenting the allocator methods. I am used by the profiler.
"
Class {
#name : 'IllInstrumentator',
#superclass : 'Object',
Expand Down
3 changes: 3 additions & 0 deletions src/IllimaniProfiler/IllInstrumentatorNoAction.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
I am the instrumentator for the no action profiler. For more info, see the no action profiler class comment
"
Class {
#name : 'IllInstrumentatorNoAction',
#superclass : 'IllInstrumentator',
Expand Down
3 changes: 3 additions & 0 deletions src/IllimaniProfiler/IllNullMethodProxy.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
I am a null-object proxy method.
"
Class {
#name : 'IllNullMethodProxy',
#superclass : 'Object',
Expand Down
3 changes: 3 additions & 0 deletions src/IllimaniProfiler/NullGCActivityMonitor.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"
I am a null-object desing pattern for the GC monitor.
"
Class {
#name : 'NullGCActivityMonitor',
#superclass : 'Object',
Expand Down

0 comments on commit 942244c

Please sign in to comment.