9992
|
1 |
"
|
10061
|
2 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
|
|
3 |
All Rights Reserved
|
9992
|
4 |
|
10061
|
5 |
Permission is hereby granted, free of charge, to any person
|
|
6 |
obtaining a copy of this software and associated documentation
|
|
7 |
files (the 'Software'), to deal in the Software without
|
|
8 |
restriction, including without limitation the rights to use,
|
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10 |
copies of the Software, and to permit persons to whom the
|
|
11 |
Software is furnished to do so, subject to the following
|
|
12 |
conditions:
|
|
13 |
|
|
14 |
The above copyright notice and this permission notice shall be
|
|
15 |
included in all copies or substantial portions of the Software.
|
|
16 |
|
|
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
24 |
OTHER DEALINGS IN THE SOFTWARE.
|
9992
|
25 |
"
|
|
26 |
"{ Package: 'stx:libtool' }"
|
|
27 |
|
|
28 |
"{ NameSpace: Tools }"
|
|
29 |
|
|
30 |
Object subclass:#ProfilerInfoBuilder
|
|
31 |
instanceVariableNames:'packages percentageCutOff'
|
|
32 |
classVariableNames:''
|
|
33 |
poolDictionaries:''
|
|
34 |
category:'Interface-Browsers-New-Profiler'
|
|
35 |
!
|
|
36 |
|
|
37 |
ProfilerInfoBuilder subclass:#MethodList
|
|
38 |
instanceVariableNames:'methodsToInfoItems'
|
|
39 |
classVariableNames:''
|
|
40 |
poolDictionaries:''
|
|
41 |
privateIn:ProfilerInfoBuilder
|
|
42 |
!
|
|
43 |
|
|
44 |
!ProfilerInfoBuilder class methodsFor:'documentation'!
|
|
45 |
|
|
46 |
copyright
|
|
47 |
"
|
10061
|
48 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
|
|
49 |
All Rights Reserved
|
|
50 |
|
|
51 |
Permission is hereby granted, free of charge, to any person
|
|
52 |
obtaining a copy of this software and associated documentation
|
|
53 |
files (the 'Software'), to deal in the Software without
|
|
54 |
restriction, including without limitation the rights to use,
|
|
55 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
56 |
copies of the Software, and to permit persons to whom the
|
|
57 |
Software is furnished to do so, subject to the following
|
|
58 |
conditions:
|
9992
|
59 |
|
10061
|
60 |
The above copyright notice and this permission notice shall be
|
|
61 |
included in all copies or substantial portions of the Software.
|
|
62 |
|
|
63 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
64 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
65 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
66 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
67 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
68 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
69 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
70 |
OTHER DEALINGS IN THE SOFTWARE.
|
9992
|
71 |
"
|
|
72 |
! !
|
|
73 |
|
|
74 |
!ProfilerInfoBuilder class methodsFor:'instance creation'!
|
|
75 |
|
|
76 |
new
|
|
77 |
^ self basicNew initialize.
|
|
78 |
|
|
79 |
"Created: / 01-12-2007 / 22:46:19 / janfrog"
|
|
80 |
! !
|
|
81 |
|
|
82 |
!ProfilerInfoBuilder methodsFor:'accessing'!
|
|
83 |
|
|
84 |
items
|
|
85 |
|
|
86 |
^self subclassResponsibility
|
|
87 |
|
|
88 |
"Created: / 01-12-2007 / 23:40:07 / janfrog"
|
|
89 |
!
|
|
90 |
|
|
91 |
packages
|
|
92 |
^ packages
|
|
93 |
|
|
94 |
"Created: / 01-12-2007 / 22:45:27 / janfrog"
|
|
95 |
!
|
|
96 |
|
|
97 |
packages:something
|
|
98 |
packages := something.
|
|
99 |
|
|
100 |
"Created: / 01-12-2007 / 22:45:27 / janfrog"
|
|
101 |
!
|
|
102 |
|
|
103 |
percentageCutOff
|
|
104 |
^ percentageCutOff ? 0
|
|
105 |
|
|
106 |
"Created: / 01-12-2007 / 22:45:27 / janfrog"
|
|
107 |
!
|
|
108 |
|
|
109 |
percentageCutOff:something
|
|
110 |
percentageCutOff := something.
|
|
111 |
|
|
112 |
"Created: / 01-12-2007 / 22:45:27 / janfrog"
|
|
113 |
! !
|
|
114 |
|
|
115 |
!ProfilerInfoBuilder methodsFor:'initialization'!
|
|
116 |
|
|
117 |
initialize
|
|
118 |
"Invoked when a new instance is created."
|
|
119 |
|
|
120 |
"/ please change as required (and remove this comment)
|
|
121 |
"/ packages := nil.
|
|
122 |
"/ percentageCutOff := nil.
|
|
123 |
|
|
124 |
"/ super initialize. -- commented since inherited method does nothing
|
|
125 |
|
|
126 |
"Created: / 01-12-2007 / 22:46:19 / janfrog"
|
|
127 |
! !
|
|
128 |
|
|
129 |
!ProfilerInfoBuilder methodsFor:'testing'!
|
|
130 |
|
|
131 |
isFiltered: profileTree
|
|
132 |
|
|
133 |
profileTree totalTally < self percentageCutOff ifTrue:[^true].
|
|
134 |
packages ifNil:[^false].
|
|
135 |
^(packages includes: profileTree package) not
|
|
136 |
|
|
137 |
"Created: / 01-12-2007 / 22:56:49 / janfrog"
|
|
138 |
! !
|
|
139 |
|
|
140 |
!ProfilerInfoBuilder::MethodList class methodsFor:'documentation'!
|
|
141 |
|
|
142 |
version
|
10061
|
143 |
^'$Id: Tools__ProfilerInfoBuilder.st,v 1.2 2011-07-03 17:46:45 cg Exp $'
|
9992
|
144 |
! !
|
|
145 |
|
|
146 |
!ProfilerInfoBuilder::MethodList methodsFor:'accessing'!
|
|
147 |
|
|
148 |
items
|
|
149 |
|
|
150 |
^methodsToInfoItems values asSortedCollection:
|
|
151 |
[:a :b|a tally > b tally]
|
|
152 |
|
|
153 |
"Created: / 01-12-2007 / 23:40:34 / janfrog"
|
|
154 |
! !
|
|
155 |
|
|
156 |
!ProfilerInfoBuilder::MethodList methodsFor:'building'!
|
|
157 |
|
|
158 |
build: profileTree
|
|
159 |
|
|
160 |
(self isFiltered: profileTree) ifFalse:
|
|
161 |
[(self itemForMethod: profileTree method) tallyAdd: profileTree leafTally].
|
|
162 |
profileTree called ifNotNil:
|
|
163 |
[profileTree called do:[:e|self build:e]]
|
|
164 |
|
|
165 |
"Created: / 01-12-2007 / 22:49:55 / janfrog"
|
|
166 |
! !
|
|
167 |
|
|
168 |
!ProfilerInfoBuilder::MethodList methodsFor:'initialization'!
|
|
169 |
|
|
170 |
initialize
|
|
171 |
|
|
172 |
super initialize.
|
|
173 |
methodsToInfoItems := Dictionary new
|
|
174 |
|
|
175 |
"Modified: / 01-12-2007 / 22:48:43 / janfrog"
|
|
176 |
! !
|
|
177 |
|
|
178 |
!ProfilerInfoBuilder::MethodList methodsFor:'private'!
|
|
179 |
|
|
180 |
itemForMethod: method
|
|
181 |
|
|
182 |
^methodsToInfoItems
|
|
183 |
at: method
|
|
184 |
ifAbsentPut:[ProfilerInfoItem new method: method]
|
|
185 |
|
|
186 |
"Created: / 01-12-2007 / 22:52:35 / janfrog"
|
|
187 |
! !
|
|
188 |
|
|
189 |
!ProfilerInfoBuilder class methodsFor:'documentation'!
|
|
190 |
|
|
191 |
version_CVS
|
10061
|
192 |
^ '$Header: /cvs/stx/stx/libtool/Tools__ProfilerInfoBuilder.st,v 1.2 2011-07-03 17:46:45 cg Exp $'
|
9992
|
193 |
!
|
|
194 |
|
|
195 |
version_SVN
|
|
196 |
^ '§Id: Tools__ProfilerInfoBuilder.st 7486 2009-10-26 22:06:24Z vranyj1 §'
|
|
197 |
! !
|