Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
8a075bc94563
Commit
4401e3cf
authored
Mar 30, 2009
by
Nicolas Chauvat
Browse files
[devtools] improve output of exlog command
parent
6937dfb242fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
devtools/devctl.py
View file @
8a075bc9
...
...
@@ -520,13 +520,15 @@ class ExamineLogCommand(Command):
try
:
rql
,
time
=
line
.
split
(
'--'
)
rql
=
re
.
sub
(
"(
\'
\w+': \d*)"
,
''
,
rql
)
if
'{'
in
rql
:
rql
=
rql
[:
rql
.
index
(
'{'
)]
req
=
requests
.
setdefault
(
rql
,
[])
time
.
strip
()
chunks
=
time
.
split
()
cputime
=
float
(
chunks
[
-
3
])
req
.
append
(
cputime
)
except
Exception
,
exc
:
sys
.
stderr
.
write
(
'Line %s: %s
\n
'
%
(
lineno
,
exc
))
sys
.
stderr
.
write
(
'Line %s: %s
(%s)
\n
'
%
(
lineno
,
exc
,
line
))
stat
=
[]
for
rql
,
times
in
requests
.
items
():
...
...
@@ -534,9 +536,11 @@ class ExamineLogCommand(Command):
stat
.
sort
()
stat
.
reverse
()
print
'Time ; Occurences ; Query'
total_time
=
sum
(
time
for
time
,
occ
,
rql
in
stat
)
*
0.01
print
'Percentage;Cumulative Time;Occurences;Query'
for
time
,
occ
,
rql
in
stat
:
print
time
,
';'
,
occ
,
';'
,
rql
print
'%.2f;%.2f;%s;%s'
%
(
time
/
total_
time
,
time
,
occ
,
rql
)
register_commands
((
UpdateCubicWebCatalogCommand
,
UpdateTemplateCatalogCommand
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment