Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of undefined indexes when running start page #19

Open
GoogleCodeExporter opened this issue Mar 27, 2015 · 7 comments
Open

Lots of undefined indexes when running start page #19

GoogleCodeExporter opened this issue Mar 27, 2015 · 7 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Just load it

What is the expected output? What do you see instead?
No PHP Warnings


What version of the product are you using? On what operating system?
phpmemcacheadmin 1.2.2 - Windows 7 x64, PHP 5.3.14, newest memcached for windows




Original issue reported on code.google.com by [email protected] on 15 Feb 2013 at 9:12

@GoogleCodeExporter
Copy link
Author

Error occurs here:

$slabs[$id]['request_rate'] = @sprintf('%.1f', ($slab['get_hits'] + 
$slab['cmd_set'] + $slab['delete_hits'] + $slab['cas_hits'] + 
$slab['cas_badval'] + $slab['incr_hits'] + $slab['decr_hits']) / 
$slabs['uptime'], 1);
                $slabs[$id]['mem_wasted'] = (($slab['total_chunks'] * $slab['chunk_size']) < $slab['mem_requested']) ?(($slab['total_chunks'] -  $slab['used_chunks']) * $slab['chunk_size']):(($slab['total_chunks'] * $slab['chunk_size']) - $slab['mem_requested']);

Original comment by [email protected] on 15 Feb 2013 at 9:32

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Hello,
Does this bug produce only when your cache is empty or every time ?

Original comment by [email protected] on 18 Feb 2013 at 8:48

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Everytime

Original comment by [email protected] on 18 Feb 2013 at 9:11

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

I have the same. Massive entrys in the log. Line 246 and 247

Original comment by [email protected] on 7 Mar 2013 at 6:04

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Adding this above those lines will fix it:

                if (!isset($slab['get_hits'])) $slab['get_hits'] = 0;
                if (!isset($slab['cmd_set'])) $slab['cmd_set'] = 0;
                if (!isset($slab['delete_hits'])) $slab['delete_hits'] = 0;
                if (!isset($slab['cas_hits'])) $slab['cas_hits'] = 0;
                if (!isset($slab['cas_badval'])) $slab['cas_badval'] = 0;
                if (!isset($slab['incr_hits'])) $slab['incr_hits'] = 0;
                if (!isset($slab['decr_hits'])) $slab['decr_hits'] = 0;
                if (!isset($slab['mem_requested'])) $slab['mem_requested'] = 0;

Or you can just turn notices off.

Original comment by [email protected] on 8 Mar 2013 at 3:43

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Two fixes here:

Either add error_reporting(E_ALL ^ E_NOTICE); at the top of the index.php file. 
(Bad way but it will hide the notices).

Or add the following code (solution posted above) line 246 in the 
Library/Data/Analysis.php file:

if (!isset($slab['get_hits'])) $slab['get_hits'] = 0;
if (!isset($slab['cmd_set'])) $slab['cmd_set'] = 0;
if (!isset($slab['delete_hits'])) $slab['delete_hits'] = 0;
if (!isset($slab['cas_hits'])) $slab['cas_hits'] = 0;
if (!isset($slab['cas_badval'])) $slab['cas_badval'] = 0;
if (!isset($slab['incr_hits'])) $slab['incr_hits'] = 0;
if (!isset($slab['decr_hits'])) $slab['decr_hits'] = 0;
if (!isset($slab['mem_requested'])) $slab['mem_requested'] = 0;

Original comment by [email protected] on 14 Nov 2014 at 10:33

  • Added labels: ****
  • Removed labels: ****

@fgm
Copy link
Contributor

fgm commented Feb 4, 2020

Similar issue with PMCA 1.3.0 and Memcache 1.5.17 to 1.5.19:

mem_requested moved from slab stats to item stats, as per https://github.com/memcached/memcached/wiki/ReleaseNotes1517

So in Analysis::slabs(), one needs to fetch either $slab['mem_requested'] for earlier versions, or $slab['items:mem_requested'] for newer versions.

fgm added a commit to fgm/phpmemcacheadmin that referenced this issue Apr 6, 2020
fgm added a commit to fgm/phpmemcacheadmin that referenced this issue Apr 6, 2020
fgm added a commit to fgm/phpmemcacheadmin that referenced this issue Apr 6, 2020
fgm added a commit to fgm/phpmemcacheadmin that referenced this issue Apr 6, 2020
fgm added a commit to fgm/phpmemcacheadmin that referenced this issue Apr 6, 2020
fgm added a commit to fgm/phpmemcacheadmin that referenced this issue Apr 6, 2020
cfoellmann added a commit that referenced this issue Apr 7, 2020
Issue #19: fix mem_requested key change in Memcached 1.5.17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants