Skip to content

Conversation

@eranra
Copy link
Collaborator

@eranra eranra commented Apr 10, 2022

No description provided.

@eranra eranra requested review from KalmanMeth and ronensc April 10, 2022 16:28
@eranra eranra linked an issue Apr 10, 2022 that may be closed by this pull request
@eranra eranra force-pushed the 126_clean_aggregates branch from 5cc400c to c4cef02 Compare April 10, 2022 16:29
@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2022

Codecov Report

Merging #178 (77ea806) into main (a1d72e8) will increase coverage by 0.61%.
The diff coverage is 92.06%.

@@            Coverage Diff             @@
##             main     #178      +/-   ##
==========================================
+ Coverage   57.86%   58.48%   +0.61%     
==========================================
  Files          58       58              
  Lines        3318     3365      +47     
==========================================
+ Hits         1920     1968      +48     
+ Misses       1270     1268       -2     
- Partials      128      129       +1     
Flag Coverage Δ
unittests 58.48% <92.06%> (+0.61%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/pipeline/extract/aggregate/aggregate.go 93.95% <89.65%> (-1.13%) ⬇️
pkg/pipeline/extract/aggregate/aggregates.go 90.90% <94.11%> (+16.62%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1d72e8...77ea806. Read the comment docs.

@eranra eranra force-pushed the 126_clean_aggregates branch from c4cef02 to cc924c7 Compare April 14, 2022 08:34
@eranra eranra force-pushed the 126_clean_aggregates branch from cc924c7 to 77ea806 Compare April 14, 2022 09:34
@eranra eranra merged commit 6eea033 into netobserv:main Apr 14, 2022
Comment on lines +95 to +97
aggregate.mutex.Lock()
aggregate.cleanupExpiredEntries()
aggregate.mutex.Unlock()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to move the Lock()/Unlock() inside aggregate.cleanupExpiredEntries() as done in GetMetrics() and UpdateByEntry()

Comment on lines +72 to +75
time.Sleep(2 * time.Second) // still exists after 2 seconds
require.Equal(t, 1, len(aggregates.Aggregates[0].GetMetrics()))
time.Sleep(3 * time.Second) // expires after 3 more seconds (5 seconds in total)
require.Equal(t, 0, len(aggregates.Aggregates[0].GetMetrics()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aggregate: cleanup aggregates

4 participants