Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mutalyzer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
mutalyzer
Commits
47ce0ee3
Commit
47ce0ee3
authored
9 years ago
by
Vermaat
Browse files
Options
Downloads
Patches
Plain Diff
Clarify Redis client import in stats module
parent
4e4798c5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mutalyzer/stats.py
+4
-4
4 additions, 4 deletions
mutalyzer/stats.py
with
4 additions
and
4 deletions
mutalyzer/stats.py
+
4
−
4
View file @
47ce0ee3
...
@@ -21,7 +21,7 @@ from __future__ import unicode_literals
...
@@ -21,7 +21,7 @@ from __future__ import unicode_literals
import
time
import
time
from
mutalyzer
.redisclient
import
client
from
.redisclient
import
client
as
redis
# Label, bucket definition, expiration time in seconds.
# Label, bucket definition, expiration time in seconds.
...
@@ -34,7 +34,7 @@ def increment_counter(counter):
...
@@ -34,7 +34,7 @@ def increment_counter(counter):
"""
"""
Increment the specified counter.
Increment the specified counter.
"""
"""
pipe
=
client
.
pipeline
(
transaction
=
False
)
pipe
=
redis
.
pipeline
(
transaction
=
False
)
pipe
.
incr
(
'
counter:%s:total
'
%
counter
)
pipe
.
incr
(
'
counter:%s:total
'
%
counter
)
for
label
,
bucket
,
expire
in
INTERVALS
:
for
label
,
bucket
,
expire
in
INTERVALS
:
...
@@ -56,9 +56,9 @@ def get_totals():
...
@@ -56,9 +56,9 @@ def get_totals():
Known counters are just those that have been incremented at least once.
Known counters are just those that have been incremented at least once.
"""
"""
counters
=
client
.
keys
(
'
counter:*:total
'
)
counters
=
redis
.
keys
(
'
counter:*:total
'
)
pipe
=
client
.
pipeline
(
transaction
=
False
)
pipe
=
redis
.
pipeline
(
transaction
=
False
)
for
counter
in
counters
:
for
counter
in
counters
:
pipe
.
get
(
counter
)
pipe
.
get
(
counter
)
...
...
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