Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
py-heptapod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
heptapod
py-heptapod
Commits
a1a961ac8c5e
Commit
a1a961ac8c5e
authored
2 years ago
by
Georges Racinet
Browse files
Options
Downloads
Patches
Plain Diff
WIP clearer logs
parent
06c4806e2ebd
Branches
topic/default/repo-cache
No related tags found
1 merge request
!67
Topic/default/repo cache
Pipeline
#97453
canceled
1 month ago
Stage: main
Stage: compat
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hgext3rd/heptapod/repo_cache.py
+14
-4
14 additions, 4 deletions
hgext3rd/heptapod/repo_cache.py
with
14 additions
and
4 deletions
hgext3rd/heptapod/repo_cache.py
+
14
−
4
View file @
a1a961ac
...
...
@@ -27,6 +27,7 @@
hg
,
util
,
)
from
mercurial.localrepo
import
localrepository
from
mercurial.repoview
import
_filteredrepotypes
logger
=
logging
.
getLogger
(
__file__
)
...
...
@@ -73,7 +74,7 @@
return
target_len
=
max
(
1
,
int
(
initial_len
*
self
.
drop_ratio
))
logger
.
warning
(
"
Current RSS %d (%d MB) is above threshold %d
MB.
"
logger
.
warning
(
"
Current RSS %d (%d M
i
B) is above threshold %d
"
"
Dropping %d repository instances from cache
"
,
current_rss
,
current_rss
>>
20
,
self
.
rss_threshold
,
initial_len
-
target_len
)
...
...
@@ -97,4 +98,7 @@
n
.
markempty
()
n
=
n
.
prev
gc
.
collect
()
count
=
sum
(
1
for
o
in
gc
.
get_objects
()
if
isinstance
(
o
,
localrepository
))
logger
.
info
(
"
Right after dropping repository instances from cache,
"
...
...
@@ -100,6 +104,9 @@
logger
.
info
(
"
Right after dropping repository instances from cache,
"
"
and calling GC, RSS is at %dMB
"
,
self
.
process
.
memory_info
().
rss
>>
20
)
"
and garbage collection, RSS is at %dMB, target_len=%d,
"
"
new cache length=%d,
"
"
total count of live repository object in process is %d
"
,
self
.
process
.
memory_info
().
rss
>>
20
,
target_len
,
len
(
self
.
_cache
),
count
)
def
acknowledge_mutation
(
repo
):
...
...
@@ -169,5 +176,5 @@
# any mutation since the system was introduced, hence a cached instance
# that reflects that is not stale.
if
read_mutation_id
(
repo
)
==
getattr
(
repo
,
MUTATION_ID_ATTR
):
logger
.
debug
(
"
Repository %r: returning from cache
"
,
path
)
logger
.
info
(
"
Repository %r: returning from cache
"
,
path
)
return
repo
...
...
@@ -173,4 +180,7 @@
return
repo
else
:
logger
.
info
(
"
Repository %r is stale. Will make new instance
"
,
path
)
# repo not found in cache or was stale
logger
.
info
(
"
Repository %r: making new instance
"
,
path
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment