-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moving metric computation in entites
- Loading branch information
HLAD Nicolas
committed
Jul 23, 2024
1 parent
703f312
commit 3f51497
Showing
8 changed files
with
194 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Class { | ||
#name : #MyLogs, | ||
#superclass : #Object, | ||
#classVars : [ | ||
'i', | ||
'size' | ||
], | ||
#category : #'GitLabHealth-Model-Analysis' | ||
} | ||
|
||
{ #category : #accessing } | ||
MyLogs class >> i [ | ||
^ i | ||
] | ||
|
||
{ #category : #accessing } | ||
MyLogs class >> increment [ | ||
|
||
^ i := i + 1 | ||
] | ||
|
||
{ #category : #progress } | ||
MyLogs class >> logProgress: aString over: aCollection [ | ||
|
||
('' join: { | ||
aString. | ||
' '. | ||
self increment printString. | ||
'/'. | ||
aCollection size }) recordInfo. | ||
i >= aCollection size ifTrue: [ self reset ] | ||
] | ||
|
||
{ #category : #'instance creation' } | ||
MyLogs class >> newLogNamed: aName [ | ||
|
||
self reset. | ||
TinyLogger default addFileLoggerNamed: | ||
'gitlabhealth-' , aName , '.log' | ||
|
||
] | ||
|
||
{ #category : #initialization } | ||
MyLogs class >> reset [ | ||
i := 0. | ||
size := 0. | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Extension { #name : #GLHUser } | ||
|
||
{ #category : #'*GitLabHealth-Model-Extension' } | ||
GLHUser >> computeCommitFrequencyOver: aDateWeekMonthOrYear [ | ||
|
||
| orderedCommits | | ||
orderedCommits := self commits sortBy: #created_at. | ||
|
||
^ GitMetric4User new | ||
user: self; | ||
commitFrequencySince: orderedCommits first created_at asDateAndTime | ||
until: orderedCommits last created_at asDateAndTime | ||
overA: aDateWeekMonthOrYear | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.