From bccd450453b66911fce7d3fed6b69caeda654e5a Mon Sep 17 00:00:00 2001 From: oliveiraallex Date: Thu, 17 Sep 2026 16:12:59 +0200 Subject: [PATCH] Tonel v1 -> v3 cleanup (no code change) --- .../BaselineOfObjectStatistics.class.st | 11 +-- BaselineOfObjectStatistics/package.st | 2 +- .../ObjectStatDimension.extension.st | 6 +- .../ObjectStatSlice.extension.st | 6 +- .../ObjectStatistics.extension.st | 8 +- ObjectStatistics-NewTools/package.st | 2 +- .../ObjectStatCounterTests.class.st | 9 ++- ...atDifferentPropertiesCounterTests.class.st | 13 ++-- .../ObjectStatDimensionTests.class.st | 29 +++---- .../ObjectStatFunctionalMetricTests.class.st | 11 +-- .../ObjectStatMetricTests.class.st | 53 ++++++------- ...ObjectStatRecursiveDimensionTests.class.st | 29 +++---- .../ObjectStatisticsTests.class.st | 49 ++++++------ ObjectStatistics-Tests/package.st | 2 +- ObjectStatistics/BlockClosure.extension.st | 6 +- ObjectStatistics/ObjectStatBuilder.class.st | 35 +++++---- ObjectStatistics/ObjectStatCounter.class.st | 9 ++- ...ectStatDifferentPropertiesCounter.class.st | 23 +++--- ObjectStatistics/ObjectStatDimension.class.st | 73 +++++++++--------- .../ObjectStatFunctionMetric.class.st | 17 ++-- ObjectStatistics/ObjectStatMetric.class.st | 55 ++++++------- .../ObjectStatRecursiveDimension.class.st | 37 ++++----- ObjectStatistics/ObjectStatSlice.class.st | 27 +++---- ObjectStatistics/ObjectStatistics.class.st | 77 ++++++++++--------- ObjectStatistics/package.st | 2 +- 25 files changed, 304 insertions(+), 287 deletions(-) diff --git a/BaselineOfObjectStatistics/BaselineOfObjectStatistics.class.st b/BaselineOfObjectStatistics/BaselineOfObjectStatistics.class.st index c125a53..03ba38b 100644 --- a/BaselineOfObjectStatistics/BaselineOfObjectStatistics.class.st +++ b/BaselineOfObjectStatistics/BaselineOfObjectStatistics.class.st @@ -1,10 +1,11 @@ Class { - #name : #BaselineOfObjectStatistics, - #superclass : #BaselineOf, - #category : #BaselineOfObjectStatistics + #name : 'BaselineOfObjectStatistics', + #superclass : 'BaselineOf', + #category : 'BaselineOfObjectStatistics', + #package : 'BaselineOfObjectStatistics' } -{ #category : #baselines } +{ #category : 'baselines' } BaselineOfObjectStatistics >> baseline: spec [ spec for: #'common' do: [ @@ -25,7 +26,7 @@ BaselineOfObjectStatistics >> baseline: spec [ ] -{ #category : #accessing } +{ #category : 'accessing' } BaselineOfObjectStatistics >> projectClass [ ^ [ self class environment at: #MetacelloCypressBaselineProject ] on: NotFound diff --git a/BaselineOfObjectStatistics/package.st b/BaselineOfObjectStatistics/package.st index 150b477..17ed662 100644 --- a/BaselineOfObjectStatistics/package.st +++ b/BaselineOfObjectStatistics/package.st @@ -1 +1 @@ -Package { #name : #BaselineOfObjectStatistics } +Package { #name : 'BaselineOfObjectStatistics' } diff --git a/ObjectStatistics-NewTools/ObjectStatDimension.extension.st b/ObjectStatistics-NewTools/ObjectStatDimension.extension.st index 5ea6a8e..6d6e826 100644 --- a/ObjectStatistics-NewTools/ObjectStatDimension.extension.st +++ b/ObjectStatistics-NewTools/ObjectStatDimension.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #ObjectStatDimension } +Extension { #name : 'ObjectStatDimension' } -{ #category : #'*ObjectStatistics-NewTools' } +{ #category : '*ObjectStatistics-NewTools' } ObjectStatDimension >> inspectionTreeItems [ ^self sortedSlices ] -{ #category : #'*ObjectStatistics-NewTools' } +{ #category : '*ObjectStatistics-NewTools' } ObjectStatDimension >> itemsTreeInspectionIn: aBuilder [ diff --git a/ObjectStatistics-NewTools/ObjectStatSlice.extension.st b/ObjectStatistics-NewTools/ObjectStatSlice.extension.st index 2ef3d73..b7490e8 100644 --- a/ObjectStatistics-NewTools/ObjectStatSlice.extension.st +++ b/ObjectStatistics-NewTools/ObjectStatSlice.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #ObjectStatSlice } +Extension { #name : 'ObjectStatSlice' } -{ #category : #'*ObjectStatistics-NewTools' } +{ #category : '*ObjectStatistics-NewTools' } ObjectStatSlice >> inspectionTreeItems [ ^statistics inspectionTreeItems ] -{ #category : #'*ObjectStatistics-NewTools' } +{ #category : '*ObjectStatistics-NewTools' } ObjectStatSlice >> itemsTreeInspectionIn: aBuilder [ diff --git a/ObjectStatistics-NewTools/ObjectStatistics.extension.st b/ObjectStatistics-NewTools/ObjectStatistics.extension.st index 4935717..0f71661 100644 --- a/ObjectStatistics-NewTools/ObjectStatistics.extension.st +++ b/ObjectStatistics-NewTools/ObjectStatistics.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #ObjectStatistics } +Extension { #name : 'ObjectStatistics' } -{ #category : #'*ObjectStatistics-NewTools' } +{ #category : '*ObjectStatistics-NewTools' } ObjectStatistics class >> buildInspectionMetricsTreeFor: anObject in: aBuilder [ ^aBuilder newTree @@ -10,14 +10,14 @@ ObjectStatistics class >> buildInspectionMetricsTreeFor: anObject in: aBuilder [ yourself ] -{ #category : #'*ObjectStatistics-NewTools' } +{ #category : '*ObjectStatistics-NewTools' } ObjectStatistics >> inspectionTreeItems [ dimensions size = 1 ifTrue: [ ^dimensions first inspectionTreeItems ]. ^dimensions reject: #isEmpty ] -{ #category : #'*ObjectStatistics-NewTools' } +{ #category : '*ObjectStatistics-NewTools' } ObjectStatistics >> itemsTreeInspectionIn: aBuilder [ diff --git a/ObjectStatistics-NewTools/package.st b/ObjectStatistics-NewTools/package.st index 4ed642d..a247cc9 100644 --- a/ObjectStatistics-NewTools/package.st +++ b/ObjectStatistics-NewTools/package.st @@ -1 +1 @@ -Package { #name : #'ObjectStatistics-NewTools' } +Package { #name : 'ObjectStatistics-NewTools' } diff --git a/ObjectStatistics-Tests/ObjectStatCounterTests.class.st b/ObjectStatistics-Tests/ObjectStatCounterTests.class.st index 18da265..726de9e 100644 --- a/ObjectStatistics-Tests/ObjectStatCounterTests.class.st +++ b/ObjectStatistics-Tests/ObjectStatCounterTests.class.st @@ -1,10 +1,11 @@ Class { - #name : #ObjectStatCounterTests, - #superclass : #TestCase, - #category : 'ObjectStatistics-Tests' + #name : 'ObjectStatCounterTests', + #superclass : 'TestCase', + #category : 'ObjectStatistics-Tests', + #package : 'ObjectStatistics-Tests' } -{ #category : #tests } +{ #category : 'tests' } ObjectStatCounterTests >> testMeasureObjects [ | counter | diff --git a/ObjectStatistics-Tests/ObjectStatDifferentPropertiesCounterTests.class.st b/ObjectStatistics-Tests/ObjectStatDifferentPropertiesCounterTests.class.st index 11afa7c..121aec7 100644 --- a/ObjectStatistics-Tests/ObjectStatDifferentPropertiesCounterTests.class.st +++ b/ObjectStatistics-Tests/ObjectStatDifferentPropertiesCounterTests.class.st @@ -1,10 +1,11 @@ Class { - #name : #ObjectStatDifferentPropertiesCounterTests, - #superclass : #TestCase, - #category : 'ObjectStatistics-Tests' + #name : 'ObjectStatDifferentPropertiesCounterTests', + #superclass : 'TestCase', + #category : 'ObjectStatistics-Tests', + #package : 'ObjectStatistics-Tests' } -{ #category : #tests } +{ #category : 'tests' } ObjectStatDifferentPropertiesCounterTests >> testCreationNewMetricForDimension [ | metric actual | @@ -16,7 +17,7 @@ ObjectStatDifferentPropertiesCounterTests >> testCreationNewMetricForDimension [ actual measuredProperties should not be: metric measuredProperties ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDifferentPropertiesCounterTests >> testMeasureObjects [ | counter | @@ -27,7 +28,7 @@ ObjectStatDifferentPropertiesCounterTests >> testMeasureObjects [ (counter measure: #(#object2)) should be: 1 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDifferentPropertiesCounterTests >> testMeasureObjectsWhenPropertyIsCollection [ | counter | diff --git a/ObjectStatistics-Tests/ObjectStatDimensionTests.class.st b/ObjectStatistics-Tests/ObjectStatDimensionTests.class.st index f43f33b..c05ddcb 100644 --- a/ObjectStatistics-Tests/ObjectStatDimensionTests.class.st +++ b/ObjectStatistics-Tests/ObjectStatDimensionTests.class.st @@ -1,10 +1,11 @@ Class { - #name : #ObjectStatDimensionTests, - #superclass : #TestCase, - #category : 'ObjectStatistics-Tests' + #name : 'ObjectStatDimensionTests', + #superclass : 'TestCase', + #category : 'ObjectStatistics-Tests', + #package : 'ObjectStatistics-Tests' } -{ #category : #tests } +{ #category : 'tests' } ObjectStatDimensionTests >> testCheckThatMetricIsIgnored [ | dimension | @@ -17,7 +18,7 @@ ObjectStatDimensionTests >> testCheckThatMetricIsIgnored [ dimension should not be isIgnoreMetric: (ObjectStatMetric named: 'someOtherMetric') ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDimensionTests >> testConvertingToDimension [ | dimension | @@ -26,7 +27,7 @@ ObjectStatDimensionTests >> testConvertingToDimension [ dimension where asObjectStatDimension should be: dimension ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDimensionTests >> testCopyForSubDimension [ | dimension copy | @@ -41,7 +42,7 @@ ObjectStatDimensionTests >> testCopyForSubDimension [ copy slices should beInstanceOf: Dictionary ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDimensionTests >> testGettingSortedSlices [ | dimension actual stat | @@ -60,7 +61,7 @@ ObjectStatDimensionTests >> testGettingSortedSlices [ actual where last coordinate should be: 4. ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDimensionTests >> testHasAnyObjectsSpecByDefault [ | dimension | @@ -69,7 +70,7 @@ ObjectStatDimensionTests >> testHasAnyObjectsSpecByDefault [ (dimension objectsSpec == Any) should be: true ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDimensionTests >> testHasEmptySlicesByDefault [ | dimension | @@ -78,7 +79,7 @@ ObjectStatDimensionTests >> testHasEmptySlicesByDefault [ dimension where slices should be isEmpty ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDimensionTests >> testHasEmptySubDimensionsByDefault [ | dimension | @@ -87,7 +88,7 @@ ObjectStatDimensionTests >> testHasEmptySubDimensionsByDefault [ dimension where subDimensions should be isEmpty ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDimensionTests >> testObjectsAccumulationShouldSkipObjectsWhichNotSatisfiedSpec [ | dimension slice | @@ -102,7 +103,7 @@ ObjectStatDimensionTests >> testObjectsAccumulationShouldSkipObjectsWhichNotSati slice should not receive accumulate: #object ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDimensionTests >> testObjectsAccumulationWhenNoSlicesExist [ | dimension overallStat slice | @@ -119,7 +120,7 @@ ObjectStatDimensionTests >> testObjectsAccumulationWhenNoSlicesExist [ slice statistics should receive accumulate: #object ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDimensionTests >> testObjectsAccumulationWhenSliceAlreadyExistsForIt [ | dimension slice | @@ -133,7 +134,7 @@ ObjectStatDimensionTests >> testObjectsAccumulationWhenSliceAlreadyExistsForIt [ slice should receive accumulate: #object ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatDimensionTests >> testPreparingStatistics [ | dimension | diff --git a/ObjectStatistics-Tests/ObjectStatFunctionalMetricTests.class.st b/ObjectStatistics-Tests/ObjectStatFunctionalMetricTests.class.st index 53d2c93..7dc7c66 100644 --- a/ObjectStatistics-Tests/ObjectStatFunctionalMetricTests.class.st +++ b/ObjectStatistics-Tests/ObjectStatFunctionalMetricTests.class.st @@ -1,10 +1,11 @@ Class { - #name : #ObjectStatFunctionalMetricTests, - #superclass : #TestCase, - #category : 'ObjectStatistics-Tests' + #name : 'ObjectStatFunctionalMetricTests', + #superclass : 'TestCase', + #category : 'ObjectStatistics-Tests', + #package : 'ObjectStatistics-Tests' } -{ #category : #tests } +{ #category : 'tests' } ObjectStatFunctionalMetricTests >> testCreationFromBlock [ | metric block | @@ -16,7 +17,7 @@ ObjectStatFunctionalMetricTests >> testCreationFromBlock [ metric functionBlock should be: block ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatFunctionalMetricTests >> testMeasureObjects [ | object metric actual | diff --git a/ObjectStatistics-Tests/ObjectStatMetricTests.class.st b/ObjectStatistics-Tests/ObjectStatMetricTests.class.st index ef8e706..9218cf6 100644 --- a/ObjectStatistics-Tests/ObjectStatMetricTests.class.st +++ b/ObjectStatistics-Tests/ObjectStatMetricTests.class.st @@ -1,10 +1,11 @@ Class { - #name : #ObjectStatMetricTests, - #superclass : #TestCase, - #category : 'ObjectStatistics-Tests' + #name : 'ObjectStatMetricTests', + #superclass : 'TestCase', + #category : 'ObjectStatistics-Tests', + #package : 'ObjectStatistics-Tests' } -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testCheckForMeaningful [ | metric parent | @@ -19,7 +20,7 @@ ObjectStatMetricTests >> testCheckForMeaningful [ metric should not be isMeaningful. ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testCheckForMeaningfulWhenParentAbsent [ | metric | @@ -29,7 +30,7 @@ ObjectStatMetricTests >> testCheckForMeaningfulWhenParentAbsent [ metric should be isMeaningful ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testComparisonToAnotherMetric [ | metric metric2 | @@ -43,7 +44,7 @@ ObjectStatMetricTests >> testComparisonToAnotherMetric [ metric2 should be > metric. ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testComputingPercentWhenNoParent [ | metric | @@ -54,7 +55,7 @@ ObjectStatMetricTests >> testComputingPercentWhenNoParent [ metric percentage should equal: 100 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testComputingPercentage [ | metric parentMetric | @@ -67,7 +68,7 @@ ObjectStatMetricTests >> testComputingPercentage [ metric percentage should equal: 10 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testConvertingClassToMetric [ | metric | @@ -77,7 +78,7 @@ ObjectStatMetricTests >> testConvertingClassToMetric [ metric should beInstanceOf: ObjectStatMetric ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testConvertingToMetric [ | metric | @@ -87,7 +88,7 @@ ObjectStatMetricTests >> testConvertingToMetric [ metric where asObjectStatMetric should be: metric ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testCreationNewMetricForDimension [ | metric actual objectsSpec | @@ -104,7 +105,7 @@ ObjectStatMetricTests >> testCreationNewMetricForDimension [ actual objectsSpec should be: objectsSpec ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testEqualToAnotherSimilarMetricWithEqualValue [ | metric metric2 | @@ -117,7 +118,7 @@ ObjectStatMetricTests >> testEqualToAnotherSimilarMetricWithEqualValue [ metric should be = metric2 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testEqualToItself [ | metric | @@ -127,7 +128,7 @@ ObjectStatMetricTests >> testEqualToItself [ metric should be = metric ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testHasAnyObjectsSpecByDefault [ | metric | @@ -136,7 +137,7 @@ ObjectStatMetricTests >> testHasAnyObjectsSpecByDefault [ (metric objectsSpec == Any) should be: true ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testHasDefaultValueByDefault [ | metric | @@ -145,7 +146,7 @@ ObjectStatMetricTests >> testHasDefaultValueByDefault [ metric value should be: metric defaultValue ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testNotEqualToAnotherMetricOfDifferentClass [ | metric metric2 | @@ -157,7 +158,7 @@ ObjectStatMetricTests >> testNotEqualToAnotherMetricOfDifferentClass [ metric should not be = metric2 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testNotEqualToAnotherSimilarMetricWithDifferentValue [ | metric metric2 | @@ -170,7 +171,7 @@ ObjectStatMetricTests >> testNotEqualToAnotherSimilarMetricWithDifferentValue [ metric should not be = metric2 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testPrinting [ | metric | @@ -182,7 +183,7 @@ ObjectStatMetricTests >> testPrinting [ metric printString should equal: '1000 (10.24%)' ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testPrintingWhenNamedExists [ | metric | @@ -194,7 +195,7 @@ ObjectStatMetricTests >> testPrintingWhenNamedExists [ metric printString should equal: '1000 test params (10.24%)' ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testPrintingWhenNoParent [ | metric | @@ -205,7 +206,7 @@ ObjectStatMetricTests >> testPrintingWhenNoParent [ metric printString should equal: '1000' ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testResultAccumulation [ | metric result | @@ -221,7 +222,7 @@ ObjectStatMetricTests >> testResultAccumulation [ result should be: 30 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testResultAccumulationForCollectionOfObjects [ | metric result | @@ -235,7 +236,7 @@ ObjectStatMetricTests >> testResultAccumulationForCollectionOfObjects [ result should be: 30 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testResultAccumulationShouldSkipObjectsWhichNotMatchesSpec [ | metric result | @@ -252,7 +253,7 @@ ObjectStatMetricTests >> testResultAccumulationShouldSkipObjectsWhichNotMatchesS metric should not receive measure: #object2 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testSettingObjectsSpec [ | metric spec | @@ -264,7 +265,7 @@ ObjectStatMetricTests >> testSettingObjectsSpec [ metric objectsSpec should be: spec ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testSettingObjectsSpecByBlock [ | metric block | @@ -277,7 +278,7 @@ ObjectStatMetricTests >> testSettingObjectsSpecByBlock [ metric objectsSpec predicate should be: block ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatMetricTests >> testSettingObjectsSpecBySymbol [ | metric | diff --git a/ObjectStatistics-Tests/ObjectStatRecursiveDimensionTests.class.st b/ObjectStatistics-Tests/ObjectStatRecursiveDimensionTests.class.st index 13efe49..de56ebe 100644 --- a/ObjectStatistics-Tests/ObjectStatRecursiveDimensionTests.class.st +++ b/ObjectStatistics-Tests/ObjectStatRecursiveDimensionTests.class.st @@ -1,26 +1,27 @@ Class { - #name : #ObjectStatRecursiveDimensionTests, - #superclass : #TestCase, + #name : 'ObjectStatRecursiveDimensionTests', + #superclass : 'TestCase', #instVars : [ 'childCall1', 'childCall2' ], - #category : 'ObjectStatistics-Tests' + #category : 'ObjectStatistics-Tests', + #package : 'ObjectStatistics-Tests' } -{ #category : #tests } +{ #category : 'tests' } ObjectStatRecursiveDimensionTests >> childCall1To: stat [ childCall1 := thisContext. stat accumulate: childCall1 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatRecursiveDimensionTests >> childCall2To: stat [ childCall2 := thisContext. stat accumulate: childCall2 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenChildrenShouldBeCountInParents [ | slice stat stop dim | @@ -46,7 +47,7 @@ ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenChildrenShouldBe slice mainMetric value should be: 2 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenChildrenShouldNotBeCountInParents [ | slice stat stop dim | @@ -72,7 +73,7 @@ ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenChildrenShouldNo slice mainMetric value should be: 2 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenCoordinateIsDifferentKindThanParentObjects [ | stat dim stop | @@ -91,7 +92,7 @@ ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenCoordinateIsDiff stat mainMetric value should be: 3 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenCoordinateIsDifferentKindThanParentObjectsAndFullStack [ | stat dim stop slices | @@ -112,7 +113,7 @@ ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenCoordinateIsDiff (slices first dimensionNamed: 'calls') sortedSlices should haveSize: 1 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenNoChildren [ | stat stop dim slice | @@ -132,7 +133,7 @@ ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenNoChildren [ slice mainMetric value should be: 2 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenSomeNotSatisfiedObjectSpec [ | slice stat stop dim | @@ -158,7 +159,7 @@ ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenSomeNotSatisfied slice mainMetric value should be: 2 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenSomeNotSatisfiedObjectSpecAndChildrenShouldBeCountInParentMetrics [ | slice stat stop dim | @@ -184,7 +185,7 @@ ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWhenSomeNotSatisfied slice mainMetric value should be: 2 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWithFullStackRecursion [ | stat dim | @@ -202,7 +203,7 @@ ObjectStatRecursiveDimensionTests >> testObjectsAccumulationWithFullStackRecursi stat mainMetric value should be: 4 ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatRecursiveDimensionTests >> testShouldNotCountChildrenInParentMetricsByDefault [ | dimension | diff --git a/ObjectStatistics-Tests/ObjectStatisticsTests.class.st b/ObjectStatistics-Tests/ObjectStatisticsTests.class.st index b3483ec..24c9b8a 100644 --- a/ObjectStatistics-Tests/ObjectStatisticsTests.class.st +++ b/ObjectStatistics-Tests/ObjectStatisticsTests.class.st @@ -1,10 +1,11 @@ Class { - #name : #ObjectStatisticsTests, - #superclass : #TestCase, - #category : 'ObjectStatistics-Tests' + #name : 'ObjectStatisticsTests', + #superclass : 'TestCase', + #category : 'ObjectStatistics-Tests', + #package : 'ObjectStatistics-Tests' } -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAccumulationAllObjects [ | stat | @@ -21,7 +22,7 @@ ObjectStatisticsTests >> testAccumulationAllObjects [ ] runWithMocks ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAccumulationObjects [ | stat | @@ -39,7 +40,7 @@ ObjectStatisticsTests >> testAccumulationObjects [ ] runWithMocks ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddNewDimension [ | dimension actual stat | @@ -52,7 +53,7 @@ ObjectStatisticsTests >> testAddNewDimension [ actual should receive overallStatistics: stat ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddNewDimensionByBlock [ | stat actual block | @@ -65,7 +66,7 @@ ObjectStatisticsTests >> testAddNewDimensionByBlock [ actual where coordinatesBlock should be: block ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddNewDimensionWithName [ | dimension stat actual result | @@ -79,7 +80,7 @@ ObjectStatisticsTests >> testAddNewDimensionWithName [ ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddNewMetric [ | metric actual stat returned | @@ -92,7 +93,7 @@ ObjectStatisticsTests >> testAddNewMetric [ actual should be: returned ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddNewMetricByBlock [ | stat actual block | @@ -105,7 +106,7 @@ ObjectStatisticsTests >> testAddNewMetricByBlock [ actual where functionBlock should be: block ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddNewMetricWithName [ | metric stat actual returned | @@ -119,7 +120,7 @@ ObjectStatisticsTests >> testAddNewMetricWithName [ ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddingCounterMetric [ | stat actual | @@ -133,7 +134,7 @@ ObjectStatisticsTests >> testAddingCounterMetric [ ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddingCounterMetricForSetOfObjects [ | stat actual | @@ -148,7 +149,7 @@ ObjectStatisticsTests >> testAddingCounterMetricForSetOfObjects [ ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddingDifferentPropertiesCountMetric [ | stat actual | @@ -162,7 +163,7 @@ ObjectStatisticsTests >> testAddingDifferentPropertiesCountMetric [ ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddingDifferentPropertiesCountMetricForSetOfObjects [ | stat actual objectsSpec | @@ -177,7 +178,7 @@ ObjectStatisticsTests >> testAddingDifferentPropertiesCountMetricForSetOfObjects ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddingDimensionWithIgnoreMetricsByFluentAPI [ | stat dimension | @@ -193,7 +194,7 @@ ObjectStatisticsTests >> testAddingDimensionWithIgnoreMetricsByFluentAPI [ stat dimensions where first ignoreMetricNames should be: #ignoredMetricNames ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddingDimensionsForSetOfObjectsByFluentAPI [ | stat dimension subDimension objectsSpec | @@ -213,7 +214,7 @@ ObjectStatisticsTests >> testAddingDimensionsForSetOfObjectsByFluentAPI [ subDimension objectsSpec should be: objectsSpec ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddingDimensionsTreeByFluentAPI [ | stat dimension1 dimension2 dimension3 dimension4 | @@ -238,7 +239,7 @@ ObjectStatisticsTests >> testAddingDimensionsTreeByFluentAPI [ stat dimensions where first subDimensions last should be: dimension3. ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddingFunctionCountMetric [ | stat actual | @@ -252,7 +253,7 @@ ObjectStatisticsTests >> testAddingFunctionCountMetric [ ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testAddingRecursiveDimension [ | stat dimension | @@ -267,7 +268,7 @@ ObjectStatisticsTests >> testAddingRecursiveDimension [ dimension name should equal: 'dim1' ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testCreationNewStatForDimension [ | stat actual | @@ -287,7 +288,7 @@ ObjectStatisticsTests >> testCreationNewStatForDimension [ ] runWithMocks ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testCreationNewStatForDimensionShouldNotAddIgnoredMetrics [ | stat actual | @@ -308,7 +309,7 @@ ObjectStatisticsTests >> testCreationNewStatForDimensionShouldNotAddIgnoredMetri ] runWithMocks ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testHasEmptyDimensionsByDefault [ | stat | @@ -317,7 +318,7 @@ ObjectStatisticsTests >> testHasEmptyDimensionsByDefault [ stat where dimensions should be isEmpty ] -{ #category : #tests } +{ #category : 'tests' } ObjectStatisticsTests >> testHasEmptyMetricsByDefault [ | stat | diff --git a/ObjectStatistics-Tests/package.st b/ObjectStatistics-Tests/package.st index 10a3b16..12b58ad 100644 --- a/ObjectStatistics-Tests/package.st +++ b/ObjectStatistics-Tests/package.st @@ -1 +1 @@ -Package { #name : #'ObjectStatistics-Tests' } +Package { #name : 'ObjectStatistics-Tests' } diff --git a/ObjectStatistics/BlockClosure.extension.st b/ObjectStatistics/BlockClosure.extension.st index a9f0b5b..f50c415 100644 --- a/ObjectStatistics/BlockClosure.extension.st +++ b/ObjectStatistics/BlockClosure.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #BlockClosure } +Extension { #name : 'BlockClosure' } -{ #category : #'*ObjectStatistics' } +{ #category : '*ObjectStatistics' } BlockClosure >> asObjectStatDimension [ ^ObjectStatDimension by: self ] -{ #category : #'*ObjectStatistics' } +{ #category : '*ObjectStatistics' } BlockClosure >> asObjectStatMetric [ ^ObjectStatFunctionMetric by: self ] diff --git a/ObjectStatistics/ObjectStatBuilder.class.st b/ObjectStatistics/ObjectStatBuilder.class.st index e494ea4..53b24b8 100644 --- a/ObjectStatistics/ObjectStatBuilder.class.st +++ b/ObjectStatistics/ObjectStatBuilder.class.st @@ -8,16 +8,17 @@ Internal Representation and Key Implementation Points. objectsSpec: " Class { - #name : #ObjectStatBuilder, - #superclass : #Object, + #name : 'ObjectStatBuilder', + #superclass : 'Object', #instVars : [ 'dimensions', 'objectsSpec' ], - #category : 'ObjectStatistics' + #category : 'ObjectStatistics', + #package : 'ObjectStatistics' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } ObjectStatBuilder class >> for: anObjectStatistics [ | builder | @@ -26,7 +27,7 @@ ObjectStatBuilder class >> for: anObjectStatistics [ ^builder ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatBuilder >> addDimension: anObjectStatDimension [ | dimension | dimension := self currentDimension addDimension: anObjectStatDimension. @@ -34,7 +35,7 @@ ObjectStatBuilder >> addDimension: anObjectStatDimension [ ^dimension ] -{ #category : #building } +{ #category : 'building' } ObjectStatBuilder >> buildDimensionsBy: aBlock [ self buildLastDimension. @@ -42,34 +43,34 @@ ObjectStatBuilder >> buildDimensionsBy: aBlock [ self buildPreviousDimension ] -{ #category : #building } +{ #category : 'building' } ObjectStatBuilder >> buildLastDimension [ dimensions add: self currentDimension lastDimension ] -{ #category : #building } +{ #category : 'building' } ObjectStatBuilder >> buildPreviousDimension [ dimensions removeLast ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatBuilder >> currentDimension [ ^dimensions last ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatBuilder >> dimensions [ ^ dimensions ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatBuilder >> dimensions: anObject [ dimensions := anObject ] -{ #category : #building } +{ #category : 'building' } ObjectStatBuilder >> for: aStateSpec buildDimensionsBy: aBlock [ | currentObjectsSpec | @@ -79,29 +80,29 @@ ObjectStatBuilder >> for: aStateSpec buildDimensionsBy: aBlock [ objectsSpec := currentObjectsSpec ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatBuilder >> ignoreMetrics: metricNames [ self currentDimension ignoreMetrics: metricNames ] -{ #category : #initialization } +{ #category : 'initialization' } ObjectStatBuilder >> initialize [ super initialize. objectsSpec := Any ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatBuilder >> objectsSpec [ ^ objectsSpec ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatBuilder >> objectsSpec: anObject [ objectsSpec := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatBuilder >> statistics: anObjectStatistics [ dimensions := OrderedCollection with: anObjectStatistics ] diff --git a/ObjectStatistics/ObjectStatCounter.class.st b/ObjectStatistics/ObjectStatCounter.class.st index 0be27de..074adc5 100644 --- a/ObjectStatistics/ObjectStatCounter.class.st +++ b/ObjectStatistics/ObjectStatCounter.class.st @@ -2,12 +2,13 @@ I am metric which count all objects " Class { - #name : #ObjectStatCounter, - #superclass : #ObjectStatMetric, - #category : 'ObjectStatistics' + #name : 'ObjectStatCounter', + #superclass : 'ObjectStatMetric', + #category : 'ObjectStatistics', + #package : 'ObjectStatistics' } -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatCounter >> measure: anObject [ ^1 ] diff --git a/ObjectStatistics/ObjectStatDifferentPropertiesCounter.class.st b/ObjectStatistics/ObjectStatDifferentPropertiesCounter.class.st index 6b81fd0..c4d5800 100644 --- a/ObjectStatistics/ObjectStatDifferentPropertiesCounter.class.st +++ b/ObjectStatistics/ObjectStatDifferentPropertiesCounter.class.st @@ -10,29 +10,30 @@ Internal Representation and Key Implementation Points. " Class { - #name : #ObjectStatDifferentPropertiesCounter, - #superclass : #ObjectStatMetric, + #name : 'ObjectStatDifferentPropertiesCounter', + #superclass : 'ObjectStatMetric', #instVars : [ 'measuredProperties', 'propertyBlock' ], - #category : 'ObjectStatistics' + #category : 'ObjectStatistics', + #package : 'ObjectStatistics' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } ObjectStatDifferentPropertiesCounter class >> for: aBlockClosure [ ^self new propertyBlock: aBlockClosure ] -{ #category : #initialization } +{ #category : 'initialization' } ObjectStatDifferentPropertiesCounter >> initialize [ super initialize. measuredProperties := IdentitySet new ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatDifferentPropertiesCounter >> measure: anObject [ | currentSize propertyValue | currentSize := measuredProperties size. @@ -45,17 +46,17 @@ ObjectStatDifferentPropertiesCounter >> measure: anObject [ ^measuredProperties size - currentSize ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDifferentPropertiesCounter >> measuredProperties [ ^ measuredProperties ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDifferentPropertiesCounter >> measuredProperties: anObject [ measuredProperties := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDifferentPropertiesCounter >> prepareForDimensionOf: anObjectStatDimension [ super prepareForDimensionOf: anObjectStatDimension. @@ -63,12 +64,12 @@ ObjectStatDifferentPropertiesCounter >> prepareForDimensionOf: anObjectStatDimen ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDifferentPropertiesCounter >> propertyBlock [ ^ propertyBlock ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDifferentPropertiesCounter >> propertyBlock: anObject [ propertyBlock := anObject ] diff --git a/ObjectStatistics/ObjectStatDimension.class.st b/ObjectStatistics/ObjectStatDimension.class.st index 0b0ae78..da7b55c 100644 --- a/ObjectStatistics/ObjectStatDimension.class.st +++ b/ObjectStatistics/ObjectStatDimension.class.st @@ -31,8 +31,8 @@ Internal Representation and Key Implementation Points. subDimensions: > " Class { - #name : #ObjectStatDimension, - #superclass : #Object, + #name : 'ObjectStatDimension', + #superclass : 'Object', #instVars : [ 'name', 'overallStatistics', @@ -42,28 +42,29 @@ Class { 'objectsSpec', 'coordinatesBlock' ], - #category : #ObjectStatistics + #category : 'ObjectStatistics', + #package : 'ObjectStatistics' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } ObjectStatDimension class >> by: aBlockClosure [ ^self new coordinatesBlock: aBlockClosure ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ObjectStatDimension class >> named: aString [ ^self new name: aString ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ObjectStatDimension class >> of: anObjectStatistics [ ^self new overallStatistics: anObjectStatistics ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatDimension >> accumulate: anObject [ | slice | @@ -74,40 +75,40 @@ ObjectStatDimension >> accumulate: anObject [ slice accumulate: anObject ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatDimension >> accumulateAll: aCollection [ ^aCollection do: [ :each | self accumulate: each ] ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> addDimension: anObjectStatDimension [ subDimensions add: anObjectStatDimension. ^anObjectStatDimension ] -{ #category : #converting } +{ #category : 'converting' } ObjectStatDimension >> asObjectStatDimension [ ^self ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatDimension >> coordinateFor: anObject [ ^coordinatesBlock value: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> coordinatesBlock [ ^ coordinatesBlock ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> coordinatesBlock: anObject [ coordinatesBlock := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> copyForSubDimension [ | copy | @@ -116,7 +117,7 @@ ObjectStatDimension >> copyForSubDimension [ ^copy ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> dimension: aDimensionOrBlock named: aString [ | dimension | @@ -128,7 +129,7 @@ ObjectStatDimension >> dimension: aDimensionOrBlock named: aString [ ] -{ #category : #testing } +{ #category : 'testing' } ObjectStatDimension >> hasSliceFor: anObject [ | coordinateObject | @@ -137,17 +138,17 @@ ObjectStatDimension >> hasSliceFor: anObject [ ^slices includesKey: coordinateObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> ignoreMetricNames [ ^ignoreMetricNames ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> ignoreMetrics: metricNames [ ignoreMetricNames := metricNames ] -{ #category : #initialization } +{ #category : 'initialization' } ObjectStatDimension >> initialize [ super initialize. @@ -157,59 +158,59 @@ ObjectStatDimension >> initialize [ objectsSpec := Any ] -{ #category : #testing } +{ #category : 'testing' } ObjectStatDimension >> isEmpty [ ^slices isEmpty ] -{ #category : #testing } +{ #category : 'testing' } ObjectStatDimension >> isIgnoreMetric: anObjectStatMetric [ ^ignoreMetricNames includes: anObjectStatMetric name ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> lastDimension [ ^subDimensions last ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> name [ ^ name ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> name: anObject [ name := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> objectsSpec [ ^ objectsSpec ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> objectsSpec: anObject [ objectsSpec := anObject asStateSpec ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> overallStatistics [ ^ overallStatistics ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> overallStatistics: anObject [ overallStatistics := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> prepareStatistics: anObjectStatistics [ subDimensions do: [ :each | anObjectStatistics addDimension: each copyForSubDimension] ] -{ #category : #printing } +{ #category : 'printing' } ObjectStatDimension >> printOn: aStream [ name ifNil: [ ^super printOn: aStream ]. @@ -219,7 +220,7 @@ ObjectStatDimension >> printOn: aStream [ nextPutAll: name ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> sliceFor: anObject [ | coordinateObject | @@ -229,28 +230,28 @@ ObjectStatDimension >> sliceFor: anObject [ ObjectStatSlice at: coordinateObject statistics: (overallStatistics newForDimension: self) ] ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> slices [ ^ slices ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> slices: anObject [ slices := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> sortedSlices [ ^slices asSortedCollection: [ :a :b | a mainMetric > b mainMetric] ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> subDimensions [ ^ subDimensions ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatDimension >> subDimensions: anObject [ subDimensions := anObject ] diff --git a/ObjectStatistics/ObjectStatFunctionMetric.class.st b/ObjectStatistics/ObjectStatFunctionMetric.class.st index fee882e..e8a0b2c 100644 --- a/ObjectStatistics/ObjectStatFunctionMetric.class.st +++ b/ObjectStatistics/ObjectStatFunctionMetric.class.st @@ -8,38 +8,39 @@ Internal Representation and Key Implementation Points. " Class { - #name : #ObjectStatFunctionMetric, - #superclass : #ObjectStatMetric, + #name : 'ObjectStatFunctionMetric', + #superclass : 'ObjectStatMetric', #instVars : [ 'functionBlock' ], - #category : 'ObjectStatistics' + #category : 'ObjectStatistics', + #package : 'ObjectStatistics' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } ObjectStatFunctionMetric class >> by: aBlockClosure [ ^self new functionBlock: aBlockClosure ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ObjectStatFunctionMetric class >> named: aString by: aBlockClosure [ ^(self named: aString) functionBlock: aBlockClosure ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatFunctionMetric >> functionBlock [ ^ functionBlock ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatFunctionMetric >> functionBlock: anObject [ functionBlock := anObject ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatFunctionMetric >> measure: anObject [ ^functionBlock value: anObject ] diff --git a/ObjectStatistics/ObjectStatMetric.class.st b/ObjectStatistics/ObjectStatMetric.class.st index 58b7c6d..b8ec310 100644 --- a/ObjectStatistics/ObjectStatMetric.class.st +++ b/ObjectStatistics/ObjectStatMetric.class.st @@ -28,41 +28,42 @@ Internal Representation and Key Implementation Points. " Class { - #name : #ObjectStatMetric, - #superclass : #Magnitude, + #name : 'ObjectStatMetric', + #superclass : 'Magnitude', #instVars : [ 'name', 'value', 'parent', 'objectsSpec' ], - #category : #ObjectStatistics + #category : 'ObjectStatistics', + #package : 'ObjectStatistics' } -{ #category : #converting } +{ #category : 'converting' } ObjectStatMetric class >> asObjectStatMetric [ ^self new ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ObjectStatMetric class >> named: aString [ ^self new name: aString ] -{ #category : #testing } +{ #category : 'testing' } ObjectStatMetric >> < anObjectStatMatric [ ^value < anObjectStatMatric value ] -{ #category : #testing } +{ #category : 'testing' } ObjectStatMetric >> = anObjectStatMatric [ self class == anObjectStatMatric class ifFalse: [ ^false ]. ^value = anObjectStatMatric value ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatMetric >> accumulate: anObject [ | result | @@ -73,7 +74,7 @@ ObjectStatMetric >> accumulate: anObject [ ^value := value + result ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatMetric >> accumulateAll: aCollection [ aCollection do: [ :each | self accumulate: each ]. @@ -81,22 +82,22 @@ ObjectStatMetric >> accumulateAll: aCollection [ ^value ] -{ #category : #converting } +{ #category : 'converting' } ObjectStatMetric >> asObjectStatMetric [ ^self ] -{ #category : #initialization } +{ #category : 'initialization' } ObjectStatMetric >> defaultValue [ ^0 ] -{ #category : #hash } +{ #category : 'hash' } ObjectStatMetric >> hash [ ^value hash ] -{ #category : #initialization } +{ #category : 'initialization' } ObjectStatMetric >> initialize [ super initialize. @@ -104,29 +105,29 @@ ObjectStatMetric >> initialize [ objectsSpec := Any ] -{ #category : #testing } +{ #category : 'testing' } ObjectStatMetric >> isMeaningful [ parent ifNil: [ ^true ]. ^parent value isZero not ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatMetric >> measure: anObject [ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatMetric >> name [ ^ name ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatMetric >> name: anObject [ name := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatMetric >> newForDimension [ | newMetric | newMetric := self copy. @@ -135,12 +136,12 @@ ObjectStatMetric >> newForDimension [ ^newMetric ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatMetric >> objectsSpec [ ^ objectsSpec ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatMetric >> objectsSpec: valuableOrSpec [ objectsSpec := valuableOrSpec isStateSpec @@ -148,17 +149,17 @@ ObjectStatMetric >> objectsSpec: valuableOrSpec [ ifFalse: [ SpecOfObjectStateByPredicate from: valuableOrSpec ] ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatMetric >> parent [ ^ parent ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatMetric >> parent: anObject [ parent := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatMetric >> percentage [ parent ifNil: [ ^100 ]. @@ -167,14 +168,14 @@ ObjectStatMetric >> percentage [ ^value * 100 / parent value ] -{ #category : #initialization } +{ #category : 'initialization' } ObjectStatMetric >> prepareForDimensionOf: parentMetric [ value := self defaultValue. parent := parentMetric. ] -{ #category : #printing } +{ #category : 'printing' } ObjectStatMetric >> printOn: aStream [ self value printOn: aStream. @@ -187,12 +188,12 @@ ObjectStatMetric >> printOn: aStream [ aStream nextPutAll: '%)'] ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatMetric >> value [ ^value ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatMetric >> value: aNumber [ value := aNumber ] diff --git a/ObjectStatistics/ObjectStatRecursiveDimension.class.st b/ObjectStatistics/ObjectStatRecursiveDimension.class.st index 5f41f42..1e8967e 100644 --- a/ObjectStatistics/ObjectStatRecursiveDimension.class.st +++ b/ObjectStatistics/ObjectStatRecursiveDimension.class.st @@ -15,23 +15,24 @@ Internal Representation and Key Implementation Points. shouldCountChildrenInParentMetrics: " Class { - #name : #ObjectStatRecursiveDimension, - #superclass : #ObjectStatDimension, + #name : 'ObjectStatRecursiveDimension', + #superclass : 'ObjectStatDimension', #instVars : [ 'shouldCountChildrenInParentMetrics', 'parentRecursionBlock', 'ownerObjects' ], - #category : 'ObjectStatistics' + #category : 'ObjectStatistics', + #package : 'ObjectStatistics' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } ObjectStatRecursiveDimension class >> by: slicesBlock recursion: propertyBlock [ ^(self by: slicesBlock) parentRecursionBlock: propertyBlock ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatRecursiveDimension >> accumulate: anObject [ (objectsSpec matches: anObject ) ifFalse: [ ^self ]. @@ -40,7 +41,7 @@ ObjectStatRecursiveDimension >> accumulate: anObject [ ] -{ #category : #private } +{ #category : 'private' } ObjectStatRecursiveDimension >> accumulateParentsOf: anObject whichIsLowermostChild: isLowermostChild [ | currentParent sliceForParent slice | @@ -57,12 +58,12 @@ ObjectStatRecursiveDimension >> accumulateParentsOf: anObject whichIsLowermostCh accumulateParentsOf: anObject whichIsLowermostChild: isLowermostChild ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatRecursiveDimension >> addOwnerObject: anObject [ ownerObjects add: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatRecursiveDimension >> copyForSubDimension [ | copy | copy := super copyForSubDimension. @@ -70,7 +71,7 @@ ObjectStatRecursiveDimension >> copyForSubDimension [ ^copy ] -{ #category : #private } +{ #category : 'private' } ObjectStatRecursiveDimension >> findParentOf: anObject [ | parent | @@ -82,7 +83,7 @@ ObjectStatRecursiveDimension >> findParentOf: anObject [ ^parent ] -{ #category : #initialization } +{ #category : 'initialization' } ObjectStatRecursiveDimension >> initialize [ super initialize. ownerObjects := Set new. @@ -90,27 +91,27 @@ ObjectStatRecursiveDimension >> initialize [ shouldCountChildrenInParentMetrics := false ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatRecursiveDimension >> ownerObjects [ ^ ownerObjects ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatRecursiveDimension >> ownerObjects: aSet [ ownerObjects := aSet ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatRecursiveDimension >> parentRecursionBlock [ ^ parentRecursionBlock ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatRecursiveDimension >> parentRecursionBlock: anObject [ parentRecursionBlock := anObject ] -{ #category : #private } +{ #category : 'private' } ObjectStatRecursiveDimension >> prepareStatistics: anObjectStatistics [ super prepareStatistics: anObjectStatistics. @@ -118,17 +119,17 @@ ObjectStatRecursiveDimension >> prepareStatistics: anObjectStatistics [ anObjectStatistics addDimension: self copyForSubDimension ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatRecursiveDimension >> shouldCountChildrenInParentMetrics [ ^ shouldCountChildrenInParentMetrics ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatRecursiveDimension >> shouldCountChildrenInParentMetrics: anObject [ shouldCountChildrenInParentMetrics := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatRecursiveDimension >> sliceFor: anObject [ | slice | diff --git a/ObjectStatistics/ObjectStatSlice.class.st b/ObjectStatistics/ObjectStatSlice.class.st index 1b7cde9..ff61db5 100644 --- a/ObjectStatistics/ObjectStatSlice.class.st +++ b/ObjectStatistics/ObjectStatSlice.class.st @@ -17,65 +17,66 @@ Internal Representation and Key Implementation Points. Implementation Points " Class { - #name : #ObjectStatSlice, - #superclass : #Object, + #name : 'ObjectStatSlice', + #superclass : 'Object', #instVars : [ 'statistics', 'coordinate' ], - #category : #ObjectStatistics + #category : 'ObjectStatistics', + #package : 'ObjectStatistics' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } ObjectStatSlice class >> at: coordinateObject statistics: anObjectStatistics [ ^self new coordinate: coordinateObject; statistics: anObjectStatistics ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatSlice >> accumulate: anObject [ ^statistics accumulate: anObject ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatSlice >> accumulate: anObject exceptingDimension: dimensionName [ ^statistics accumulate: anObject exceptingDimension: dimensionName ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatSlice >> coordinate [ ^ coordinate ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatSlice >> coordinate: anObject [ coordinate := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatSlice >> dimensionNamed: aString [ ^statistics dimensionNamed: aString ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatSlice >> mainMetric [ ^statistics mainMetric ] -{ #category : #printing } +{ #category : 'printing' } ObjectStatSlice >> printOn: aStream [ coordinate printOn: aStream. aStream nextPutAll: ': '. statistics printMetricsOn: aStream ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatSlice >> statistics [ ^ statistics ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatSlice >> statistics: anObject [ statistics := anObject ] diff --git a/ObjectStatistics/ObjectStatistics.class.st b/ObjectStatistics/ObjectStatistics.class.st index 86911ed..9e4799b 100644 --- a/ObjectStatistics/ObjectStatistics.class.st +++ b/ObjectStatistics/ObjectStatistics.class.st @@ -52,17 +52,18 @@ Internal Representation and Key Implementation Points. metrics: > " Class { - #name : #ObjectStatistics, - #superclass : #Object, + #name : 'ObjectStatistics', + #superclass : 'Object', #instVars : [ 'metrics', 'dimensions', 'dimensionsBuilder' ], - #category : #ObjectStatistics + #category : 'ObjectStatistics', + #package : 'ObjectStatistics' } -{ #category : #examples } +{ #category : 'examples' } ObjectStatistics class >> exampleFlatProfiler [ | stat prev | stat := ObjectStatistics new. @@ -87,7 +88,7 @@ ObjectStatistics class >> exampleFlatProfiler [ ^stat inspect ] -{ #category : #examples } +{ #category : 'examples' } ObjectStatistics class >> exampleMethods [ | stat | stat := ObjectStatistics new. @@ -108,7 +109,7 @@ ObjectStatistics class >> exampleMethods [ ^stat inspect ] -{ #category : #examples } +{ #category : 'examples' } ObjectStatistics class >> exampleStringsWithSingleDimension [ | stat | stat := ObjectStatistics new. @@ -121,7 +122,7 @@ ObjectStatistics class >> exampleStringsWithSingleDimension [ ^stat inspect ] -{ #category : #examples } +{ #category : 'examples' } ObjectStatistics class >> exampleStringsWithTwoDimensions [ | stat | stat := ObjectStatistics new. @@ -135,7 +136,7 @@ ObjectStatistics class >> exampleStringsWithTwoDimensions [ ^stat inspect ] -{ #category : #examples } +{ #category : 'examples' } ObjectStatistics class >> exampleTreeProfiler [ | stat prev | stat := ObjectStatistics new. @@ -156,7 +157,7 @@ ObjectStatistics class >> exampleTreeProfiler [ ^stat inspect ] -{ #category : #examples } +{ #category : 'examples' } ObjectStatistics class >> exampleTreeProfilerWithOnlyBlockStack [ | stat prev block blockContext insideBlock | stat := ObjectStatistics new. @@ -188,14 +189,14 @@ ObjectStatistics class >> exampleTreeProfilerWithOnlyBlockStack [ ^stat inspect ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatistics >> accumulate: anObject [ metrics do: [ :each | each accumulate: anObject ]. dimensions do: [ :each | each accumulate: anObject ] ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatistics >> accumulate: anObject exceptingDimension: dimensionName [ metrics do: [ :each | each accumulate: anObject ]. @@ -203,13 +204,13 @@ ObjectStatistics >> accumulate: anObject exceptingDimension: dimensionName [ each name = dimensionName ifFalse: [ each accumulate: anObject ]] ] -{ #category : #measuring } +{ #category : 'measuring' } ObjectStatistics >> accumulateAll: aCollection [ aCollection do: [ :each | self accumulate: each ] ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> addDimension: aDimensionOrBlock [ | dimension | @@ -220,7 +221,7 @@ ObjectStatistics >> addDimension: aDimensionOrBlock [ ^dimension ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> addMetric: metricSource [ | metric | metric := metricSource asObjectStatMetric. @@ -230,7 +231,7 @@ ObjectStatistics >> addMetric: metricSource [ ^metric ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> addMetric: metricSource named: aString [ | metric | metric := self addMetric: metricSource. @@ -238,24 +239,24 @@ ObjectStatistics >> addMetric: metricSource named: aString [ ^metric ] -{ #category : #'fluent api' } +{ #category : 'fluent api' } ObjectStatistics >> countAllAs: objectsName [ ^self addMetric: ObjectStatCounter named: objectsName ] -{ #category : #'fluent api' } +{ #category : 'fluent api' } ObjectStatistics >> countAllSuch: valuableOrSpec as: objectsName [ | metric | metric := self countAllAs: objectsName. metric objectsSpec: valuableOrSpec ] -{ #category : #'fluent api' } +{ #category : 'fluent api' } ObjectStatistics >> countDifferent: propertyBlock as: objectsName [ self addMetric: (ObjectStatDifferentPropertiesCounter for: propertyBlock) named: objectsName ] -{ #category : #'fluent api' } +{ #category : 'fluent api' } ObjectStatistics >> countDifferent: propertyBlock as: objectsName for: valuableOrSpec [ | metric | metric := self addMetric: (ObjectStatDifferentPropertiesCounter for: propertyBlock) named: objectsName. @@ -263,12 +264,12 @@ ObjectStatistics >> countDifferent: propertyBlock as: objectsName for: valuableO ^metric ] -{ #category : #'fluent api' } +{ #category : 'fluent api' } ObjectStatistics >> countFunction: functionBlock as: objectsName [ self addMetric: functionBlock named: objectsName ] -{ #category : #'fluent api' } +{ #category : 'fluent api' } ObjectStatistics >> dimension: aDimensionOrBlock named: aString [ | dimension | dimension := dimensionsBuilder addDimension: aDimensionOrBlock asObjectStatDimension. @@ -276,7 +277,7 @@ ObjectStatistics >> dimension: aDimensionOrBlock named: aString [ ^dimension ] -{ #category : #'fluent api' } +{ #category : 'fluent api' } ObjectStatistics >> dimension: sliceBlock named: aString recursionUpTo: parentPropertyBlock [ | dimension | dimension := ObjectStatRecursiveDimension by: sliceBlock recursion: parentPropertyBlock. @@ -285,38 +286,38 @@ ObjectStatistics >> dimension: sliceBlock named: aString recursionUpTo: parentPr ^dimension ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> dimensionNamed: aString [ ^dimensions detect: [ :each | each name = aString ] ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> dimensions [ ^ dimensions ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> dimensions: anObject [ dimensions := anObject ] -{ #category : #'fluent api' } +{ #category : 'fluent api' } ObjectStatistics >> for: aStateSpec with: dimensionsCreationBlock [ dimensionsBuilder for: aStateSpec buildDimensionsBy: dimensionsCreationBlock ] -{ #category : #testing } +{ #category : 'testing' } ObjectStatistics >> hasDimensions [ ^dimensions notEmpty ] -{ #category : #'fluent api' } +{ #category : 'fluent api' } ObjectStatistics >> ignoreMetrics: metricNames [ dimensionsBuilder ignoreMetrics: metricNames ] -{ #category : #initialization } +{ #category : 'initialization' } ObjectStatistics >> initialize [ super initialize. @@ -325,27 +326,27 @@ ObjectStatistics >> initialize [ dimensionsBuilder := ObjectStatBuilder for: self ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> lastDimension [ ^dimensions last ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> mainMetric [ ^metrics first ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> metrics [ ^ metrics ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> metrics: anObject [ metrics := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> newForDimension: anObjectStatDimension [ | newStat newMetrics | newStat := self class new. @@ -357,12 +358,12 @@ ObjectStatistics >> newForDimension: anObjectStatDimension [ ^newStat ] -{ #category : #accessing } +{ #category : 'accessing' } ObjectStatistics >> objectsSpec [ ^Any ] -{ #category : #printing } +{ #category : 'printing' } ObjectStatistics >> printMetricsOn: aStream [ metrics ifEmpty: [ ^self ]. @@ -374,7 +375,7 @@ ObjectStatistics >> printMetricsOn: aStream [ each printOn: aStream]] ] -{ #category : #printing } +{ #category : 'printing' } ObjectStatistics >> printOn: aStream [ super printOn: aStream. @@ -383,7 +384,7 @@ ObjectStatistics >> printOn: aStream [ aStream nextPutAll: ')'. ] -{ #category : #'fluent api' } +{ #category : 'fluent api' } ObjectStatistics >> with: dimensionsCreationBlock [ dimensionsBuilder buildDimensionsBy: dimensionsCreationBlock diff --git a/ObjectStatistics/package.st b/ObjectStatistics/package.st index 3bf6e37..69bbc6d 100644 --- a/ObjectStatistics/package.st +++ b/ObjectStatistics/package.st @@ -1 +1 @@ -Package { #name : #ObjectStatistics } +Package { #name : 'ObjectStatistics' }