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
090fee29
Commit
090fee29
authored
5 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
change compression scheme
parent
1eb59544
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+3
-0
3 additions, 0 deletions
CHANGELOG.md
satella/instrumentation/trace_back.py
+9
-6
9 additions, 6 deletions
satella/instrumentation/trace_back.py
with
12 additions
and
6 deletions
CHANGELOG.md
+
3
−
0
View file @
090fee29
# v2.8.4
# v2.8.4
*
changed compression of StackFrameVariables to gzip from zlib
This diff is collapsed.
Click to expand it.
satella/instrumentation/trace_back.py
+
9
−
6
View file @
090fee29
import
base64
import
base64
import
gzip
import
inspect
import
inspect
import
io
import
io
import
sys
import
sys
import
traceback
import
traceback
import
types
import
types
import
typing
as
tp
import
typing
as
tp
import
zlib
from
satella.json
import
JSONAble
from
satella.json
import
JSONAble
...
@@ -88,6 +88,9 @@ class GenerationPolicy:
...
@@ -88,6 +88,9 @@ class GenerationPolicy:
return
r
return
r
_default_generation_policy
=
GenerationPolicy
()
class
StoredVariableValue
(
JSONAble
):
class
StoredVariableValue
(
JSONAble
):
"""
"""
Class used to store a variable value. Picklable.
Class used to store a variable value. Picklable.
...
@@ -100,7 +103,7 @@ class StoredVariableValue(JSONAble):
...
@@ -100,7 +103,7 @@ class StoredVariableValue(JSONAble):
.pickle_type - what is stored in .pickle?
.pickle_type - what is stored in .pickle?
None - nothing
None - nothing
"
pickle
"
- normal Python pickle
"
pickle
"
- normal Python pickle
"
pickle/gzip
"
- Python pickle treated with
zlib
.compress
"
pickle/gzip
"
- Python pickle treated with
gzip
.compress
"
failed
"
- could not pickle, pickle contains a UTF-8 text with
"
failed
"
- could not pickle, pickle contains a UTF-8 text with
human-readable exception reason
human-readable exception reason
"
failed/gzip
"
- compression failed, pickle contains a UTF-8 text with
"
failed/gzip
"
- compression failed, pickle contains a UTF-8 text with
...
@@ -138,7 +141,7 @@ class StoredVariableValue(JSONAble):
...
@@ -138,7 +141,7 @@ class StoredVariableValue(JSONAble):
self
.
repr
=
repr
(
value
)
# type: str
self
.
repr
=
repr
(
value
)
# type: str
self
.
type_
=
repr
(
type
(
value
))
# type: str
self
.
type_
=
repr
(
type
(
value
))
# type: str
policy
=
policy
or
G
eneration
P
olicy
()
policy
=
policy
or
_default_g
eneration
_p
olicy
self
.
repr
=
policy
.
process_repr
(
self
.
repr
)
self
.
repr
=
policy
.
process_repr
(
self
.
repr
)
...
@@ -156,12 +159,12 @@ class StoredVariableValue(JSONAble):
...
@@ -156,12 +159,12 @@ class StoredVariableValue(JSONAble):
else
:
else
:
if
policy
.
should_compress
(
self
.
pickle
):
if
policy
.
should_compress
(
self
.
pickle
):
try
:
try
:
self
.
pickle
=
zlib
.
compress
(
self
.
pickle
=
gzip
.
compress
(
self
.
pickle
,
self
.
pickle
,
policy
.
get_compression_level
(
policy
.
get_compression_level
(
self
.
pickle
))
self
.
pickle
))
self
.
pickle_type
=
"
pickle/gzip
"
self
.
pickle_type
=
"
pickle/gzip
"
except
zlib
.
error
as
e
:
except
Exception
as
e
:
self
.
pickle
=
(
'
failed to gzip, reason is %s
'
%
(
repr
(
e
),)).
encode
(
'
utf8
'
)
self
.
pickle
=
(
'
failed to gzip, reason is %s
'
%
(
repr
(
e
),)).
encode
(
'
utf8
'
)
self
.
pickle_type
=
"
failed/gzip
"
self
.
pickle_type
=
"
failed/gzip
"
...
@@ -181,7 +184,7 @@ class StoredVariableValue(JSONAble):
...
@@ -181,7 +184,7 @@ class StoredVariableValue(JSONAble):
raise
ValueError
(
raise
ValueError
(
'
MemoryCondition has failed to be pickled, reason is %s
'
%
(
self
.
pickle
,))
'
MemoryCondition has failed to be pickled, reason is %s
'
%
(
self
.
pickle
,))
elif
self
.
pickle_type
==
'
pickle/gzip
'
:
elif
self
.
pickle_type
==
'
pickle/gzip
'
:
pickle_
=
zlib
.
decompress
(
self
.
pickle
)
pickle_
=
gzip
.
decompress
(
self
.
pickle
)
elif
self
.
pickle_type
==
'
pickle
'
:
elif
self
.
pickle_type
==
'
pickle
'
:
pickle_
=
self
.
pickle
pickle_
=
self
.
pickle
else
:
else
:
...
...
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