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
ai
noblogs-wp
Commits
1aece7ff
Commit
1aece7ff
authored
Oct 03, 2011
by
shammash
Committed by
agata
Oct 17, 2019
Browse files
add script to export apc stats
parent
82af9e0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
apc_stats_r2mon.php
0 → 100644
View file @
1aece7ff
<?php
function
print_stat
(
$key
,
$value
)
{
echo
"apc.
$key
{
service=php,instance=noblogs
}
:
$value
\n
"
;
}
$cache
=
apc_cache_info
(
''
,
true
);
foreach
(
$cache
as
$key
=>
$value
)
{
if
(
$key
===
"memory_type"
or
$key
===
"locking_type"
)
continue
;
print_stat
(
$key
,
$value
);
}
$mem
=
apc_sma_info
(
true
);
foreach
(
$mem
as
$key
=>
$value
)
{
print_stat
(
$key
,
$value
);
}
/*
* Significant data:
* $cache['num_entries'] => number files
* $cache['mem_size'] => size cached files
* $cache['num_hits'] => hits
* $cache['num_misses'] => misses
* $cache['expunges'] => cache full count
*
* $mem['num_seg'] * $mem['seg_size'] => memory size
* $mem['avail_mem'] => free memory
*/
?>
Write
Preview
Supports
Markdown
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