Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
98b92185
Commit
98b92185
authored
Jul 02, 2012
by
Franz Liedke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Calculate memory and peak memory usage in profiler, too.
parent
bcd63ab5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
profiler.php
laravel/profiling/profiler.php
+14
-0
No files found.
laravel/profiling/profiler.php
View file @
98b92185
...
...
@@ -28,10 +28,24 @@ class Profiler {
// type applications, so we will not send anything in those scenarios.
if
(
!
Request
::
ajax
())
{
static
::
$data
[
'memory'
]
=
static
::
get_file_size
(
memory_get_usage
(
true
));
static
::
$data
[
'memory_peak'
]
=
static
::
get_file_size
(
memory_get_peak_usage
(
true
));
static
::
$data
[
'time'
]
=
number_format
((
microtime
(
true
)
-
LARAVEL_START
)
*
1000
,
2
);
return
render
(
'path: '
.
__DIR__
.
'/template'
.
BLADE_EXT
,
static
::
$data
);
}
}
/**
* Calculate the human-readable file size (with proper units).
*
* @param int $size
* @return string
*/
private
static
function
get_file_size
(
$size
)
{
$units
=
array
(
'Bytes'
,
'KiB'
,
'MiB'
,
'GiB'
,
'TiB'
,
'PiB'
,
'EiB'
);
return
@
round
(
$size
/
pow
(
1024
,
(
$i
=
floor
(
log
(
$size
,
1024
)))),
2
)
.
' '
.
$units
[
$i
];
}
/**
* Add a log entry to the log entries array.
...
...
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