Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
36a2a877
Commit
36a2a877
authored
10 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Use time.time() instead of time.clock()
parent
d5ae67e6
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
synapse/storage/_base.py
+4
-4
4 additions, 4 deletions
synapse/storage/_base.py
with
4 additions
and
4 deletions
synapse/storage/_base.py
+
4
−
4
View file @
36a2a877
...
@@ -64,7 +64,7 @@ class LoggingTransaction(object):
...
@@ -64,7 +64,7 @@ class LoggingTransaction(object):
# Don't let logging failures stop SQL from working
# Don't let logging failures stop SQL from working
pass
pass
start
=
time
.
clock
()
*
1000
start
=
time
.
time
()
*
1000
try
:
try
:
return
self
.
txn
.
execute
(
return
self
.
txn
.
execute
(
sql
,
*
args
,
**
kwargs
sql
,
*
args
,
**
kwargs
...
@@ -73,7 +73,7 @@ class LoggingTransaction(object):
...
@@ -73,7 +73,7 @@ class LoggingTransaction(object):
logger
.
exception
(
"
[SQL FAIL] {%s}
"
,
self
.
name
)
logger
.
exception
(
"
[SQL FAIL] {%s}
"
,
self
.
name
)
raise
raise
finally
:
finally
:
end
=
time
.
clock
()
*
1000
end
=
time
.
time
()
*
1000
sql_logger
.
debug
(
"
[SQL time] {%s} %f
"
,
self
.
name
,
end
-
start
)
sql_logger
.
debug
(
"
[SQL time] {%s} %f
"
,
self
.
name
,
end
-
start
)
...
@@ -93,7 +93,7 @@ class SQLBaseStore(object):
...
@@ -93,7 +93,7 @@ class SQLBaseStore(object):
def
inner_func
(
txn
,
*
args
,
**
kwargs
):
def
inner_func
(
txn
,
*
args
,
**
kwargs
):
with
LoggingContext
(
"
runInteraction
"
)
as
context
:
with
LoggingContext
(
"
runInteraction
"
)
as
context
:
current_context
.
copy_to
(
context
)
current_context
.
copy_to
(
context
)
start
=
time
.
clock
()
*
1000
start
=
time
.
time
()
*
1000
txn_id
=
SQLBaseStore
.
_TXN_ID
txn_id
=
SQLBaseStore
.
_TXN_ID
# We don't really need these to be unique, so lets stop it from
# We don't really need these to be unique, so lets stop it from
...
@@ -109,7 +109,7 @@ class SQLBaseStore(object):
...
@@ -109,7 +109,7 @@ class SQLBaseStore(object):
logger
.
exception
(
"
[TXN FAIL] {%s}
"
,
name
)
logger
.
exception
(
"
[TXN FAIL] {%s}
"
,
name
)
raise
raise
finally
:
finally
:
end
=
time
.
clock
()
*
1000
end
=
time
.
time
()
*
1000
transaction_logger
.
debug
(
transaction_logger
.
debug
(
"
[TXN END] {%s} %f
"
,
"
[TXN END] {%s} %f
"
,
name
,
end
-
start
name
,
end
-
start
...
...
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