Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
public
satella
Commits
7fedc047
Commit
7fedc047
authored
1 year ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
get_own_cpu_usage() will now work on Windows
parent
47c9aff2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
docs/instrumentation/memory.rst
+18
-17
18 additions, 17 deletions
docs/instrumentation/memory.rst
satella/instrumentation/cpu_time/collector.py
+1
-1
1 addition, 1 deletion
satella/instrumentation/cpu_time/collector.py
with
20 additions
and
18 deletions
CHANGELOG.md
+
1
−
0
View file @
7fedc047
...
@@ -3,4 +3,5 @@
...
@@ -3,4 +3,5 @@
*
added DeferredValue
*
added DeferredValue
*
satella.coding.Context are considered experimental
*
satella.coding.Context are considered experimental
*
added a way to register an object to be cleaned up via MemoryPressureManager
*
added a way to register an object to be cleaned up via MemoryPressureManager
*
fixed get_own_cpu_usage() to work on Windows
This diff is collapsed.
Click to expand it.
docs/instrumentation/memory.rst
+
18
−
17
View file @
7fedc047
...
@@ -10,12 +10,28 @@ from Satella solves that problem.
...
@@ -10,12 +10,28 @@ from Satella solves that problem.
.. autofunction:: satella.instrumentation.memory.get_size
.. autofunction:: satella.instrumentation.memory.get_size
.. warning:: Using these conditions will spawn a daemon thread to monitor the memory usage
install_force_gc_collect
in the background.
------------------------
If you want, you can install a GC handler that will
force a complete GC collection upon entering given severity level.
.. autofunction:: satella.instrumentation.memory.install_force_gc_collect
Dumping memory information
--------------------------
.. autofunction:: satella.instrumentation.memory.dump_memory_on
.. autofunction:: satella.instrumentation.memory.install_dump_memory_on
Defining severity levels
Defining severity levels
------------------------
------------------------
.. warning:: Using following routines will spawn a daemon thread to monitor the memory usage
in the background.
To define a severity level, use the following classes:
To define a severity level, use the following classes:
.. autoclass:: satella.instrumentation.memory.GlobalAbsoluteValue
.. autoclass:: satella.instrumentation.memory.GlobalAbsoluteValue
...
@@ -57,18 +73,3 @@ that level 1 is still in effect. You can register your handlers here:
...
@@ -57,18 +73,3 @@ that level 1 is still in effect. You can register your handlers here:
Note that you can also register objects to have their methods called on entering a memory
Note that you can also register objects to have their methods called on entering a memory
severity level, if these objects have a way to to for example drop some data onto disk and
severity level, if these objects have a way to to for example drop some data onto disk and
decrease memory usage via :meth:`~satella.instrumentation.memory.MemoryPressureManager.cleanup_on_entered`.
decrease memory usage via :meth:`~satella.instrumentation.memory.MemoryPressureManager.cleanup_on_entered`.
install_force_gc_collect
------------------------
If you want, you can install a GC handler that will
force a complete GC collection upon entering given severity level.
.. autofunction:: satella.instrumentation.memory.install_force_gc_collect
Dumping memory information
--------------------------
.. autofunction:: satella.instrumentation.memory.dump_memory_on
.. autofunction:: satella.instrumentation.memory.install_dump_memory_on
This diff is collapsed.
Click to expand it.
satella/instrumentation/cpu_time/collector.py
+
1
−
1
View file @
7fedc047
...
@@ -19,7 +19,7 @@ DEFAULT_WINDOW_SECONDS = '10s'
...
@@ -19,7 +19,7 @@ DEFAULT_WINDOW_SECONDS = '10s'
pCPUtimes
=
collections
.
namedtuple
(
'
pcputimes
'
,
pCPUtimes
=
collections
.
namedtuple
(
'
pcputimes
'
,
[
'
user
'
,
'
system
'
,
'
children_user
'
,
'
children_system
'
,
[
'
user
'
,
'
system
'
,
'
children_user
'
,
'
children_system
'
,
'
iowait
'
])
'
iowait
'
]
,
defaults
=
[
0
,
0
,
0
,
0
,
0
]
)
class
_CPUProfileBuilderThread
(
SingleStartThread
):
class
_CPUProfileBuilderThread
(
SingleStartThread
):
...
...
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