eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Tools::Profiler':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Profiler (in Tools)


Inheritance:

   Object
   |
   +--MessageTally
      |
      +--Tools::Profiler

Package:
stx:libtool
Category:
Interface-Browsers-New-Profiler
Version:
rev: 1.6 date: 2021/01/20 15:30:21
user: cg
file: Tools__Profiler.st directory: libtool
module: stx stc-classLibrary: libtool

Description:


a visual profiler;
provides the same interface as a MessageTally, but does not show the
sample data on a stream, instead a browser is opened, allowing easy
navigation through the sampled code.

copyright

COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Class protocol:

instance creation
o  readStatisticsFrom: stream

messageTally compatible interface
o  spyDetailedOn: aBlock
execute a Block; then open a visual profiler.
Return the value from aBlock

o  spyOn: aBlock
execute a Block; then open a visual profiler.
Return the value from aBlock

o  spyOn: aBlock interval: interval
execute a Block; then open a visual profiler.
Return the value from aBlock

profiling
o  profile: aBlock
run aBlock, return profile information

o  profileAndOpenBrowser: aBlock
run aBlock, open a browser on the profile information; sample tick is 10ms

Usage example(s):

        Tools::Profiler profileAndOpenBrowser:[ 10000 timesRepeat:[100 factorial] ] 

o  profileDetailedOn: aBlock
run aBlock, return profile information; sample tick is 1ms

o  profileOn: aBlock
run aBlock, return profile information; sample tick is 10ms

o  profileOn: aBlock interval: interval
run aBlock, return profile information; sample tick is interval (ms)


Instance protocol:

I/O
o  storeStatisticsOn: stream

accessing
o  computationTime

o  notes

o  notes: something

o  retVal

o  startTimestamp

profiling
o  profileOn: aBlock interval: interval


Examples:


    | profiler |

    profiler := Tools::Profiler profileOn:[1 to: 1000 do:[:i|i factorial]] interval: 10.
    Tools::NewSystemBrowser browseProfilerStatistics: profiler
    Tools::Profiler spyOn:[1 to: 1000 do:[:i|i factorial]] interval: 10.


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 14:54:34 GMT