Metrics empty
-
Hey,
First of all thanks for the greate plugin.
I have a problem with metrics, it doesn’t update. here is my diagnostics:
Status: Conectado Client: PhpRedis (v5.3.1) Drop-in: Valid Disabled: No Filesystem: Working Ping: 1 Errors: [] PhpRedis: 5.3.1 Predis: Not loaded Credis: Not loaded PHP Version: 7.4.9 Plugin Version: 2.0.12 Redis Version: 4.0.11 Multisite: Yes Global Prefix: "" Blog Prefix: 1 WP_REDIS_HOST: "localhost" Global Groups: [ "blog-details", "blog-id-cache", "blog-lookup", "global-posts", "networks", "rss", "sites", "site-details", "site-lookup", "site-options", "site-transient", "users", "useremail", "userlogins", "usermeta", "user_meta", "userslugs", "blog_meta" ] Ignored Groups: [ "counts", "plugins", "themes", "wordfence", "wordfence-ls" ] Unflushable Groups: [] Drop-ins: [ "Redis Object Cache Drop-In v2.0.12 by Till Krüss", "sunrise.php v by " ]
What am I missing ?
-
Mhh, I’m guessing the
shutdown
hook isn’t called. Can you post a list of installed plugins?Hi,
It’s really weird because, i’m testing on my dev env and it works there, but in production not. They are essentially the same setup, but on productin I have different redis.conf file and nginx.conf is also different.
Below are my active plugins:
ACF OpenStreetMap Field Versão 1.2.1 por Jörn Lund Admin Color Schemes Versão 2.3 por WordPress Core Team Advanced Cron Manager Versão 2.4.0 por BracketSpace Advanced Custom Fields: Font Awesome Versão 3.1.1 por mattkeys Advanced Custom Fields: reCAPTCHA Field Versão 1.3.3 por Irvin Lim Advanced Custom Fields PRO Versão 5.9.0 por Elliot Condon AMP Versão 1.5.5 por AMP Project Contributors Breadcrumb NavXT Versão 6.5.0 por John Havlik Broadcast Versão 46.12 por edward_plainview Delete Expired Transients Versão 2.0.7 por WebAware Disable Comments Versão 1.10.3 por WPDeveloper Elementor Versão 2.9.14 por Elementor.com EWWW Image Optimizer Versão 5.7.0 por Exactly WWW F12 Profiler Versão 1.3.4 por Forge12 Interactive GmbH (Versão mais recente: 1.3.5) FG Joomla to WordPress Versão 3.70.0 por Frédéric GILLES MultiSite Clone Duplicator Versão 1.5.3 por Julien OGER, Pierre DARGHAM, David DAUGREILH, GLOBALIS media systems Proxy Cache Purge Versão 4.8.1 por Mika Epstein Redis Object Cache Versão 2.0.12 por Till Krüss SiteOrigin Widgets Bundle Versão 1.17.6 por SiteOrigin TinyMCE Advanced Versão 5.5.0 por Andrew Ozz User Role Editor Versão 4.56 por Vladimir Garagulya User Switching Versão 1.5.5 por John Blackbourn & contributors W3 Total Cache Versão 0.14.4 por BoldGrid Wordfence Security Versão 7.4.10 por Wordfence WP Responsive Recent Post Slider/Carousel Versão 2.4 por WP OnlineSupport
Strange. Nothing pops out. I’d turn off one plugin at a time, load an admin page and see if the
redis-cache:metrics
key is being created.If you can find the culprit, I can build a workaround into the plugin.
Here is my redis-cache metrics keys, the keys are being created normally:
127.0.0.1:6379> KEYS *redis-cache* 1) "347:redis-cache:metrics" 2) "445:redis-cache:metrics" 3) "559:redis-cache:metrics" 4) "407:redis-cache:metrics" 5) "342:redis-cache:metrics" 6) "526:redis-cache:metrics" 7) "607:redis-cache:metrics" 8) "501:redis-cache:metrics" 9) "441:redis-cache:metrics" 10) "791:redis-cache:metrics" 11) "359:redis-cache:metrics" 12) "368:redis-cache:metrics" 13) "546:redis-cache:metrics" 14) "416:redis-cache:metrics" 15) "569:redis-cache:metrics" 16) "341:redis-cache:metrics" 17) "535:redis-cache:metrics" 18) "373:redis-cache:metrics" 19) "450:redis-cache:metrics" 20) "362:redis-cache:metrics" 21) "397:redis-cache:metrics" 22) "378:redis-cache:metrics" 23) "1:redis-cache:metrics" 24) "553:redis-cache:metrics" 25) "372:redis-cache:metrics" 26) "479:redis-cache:metrics" 27) "405:redis-cache:metrics" 28) "547:redis-cache:metrics" 29) "529:redis-cache:metrics"
But when I do MGET the key contet is “nil”:
127.0.0.1:6379> MGET 1:redis-cache:metrics
1) (nil)Disabled all plugins the problem persists.
now i’m considering disabling all metrics because my users do not need to see this information in their dashboard.
Can you try
HGETALL 1:redis-cache:metrics
?Very strange. What does
TYPE 1:redis-cache:metrics
say?127.0.0.1:6379> TYPE 1:redis-cache:metrics zset
Yikes, my mistake. The right command was:
zrangebyscore 1:redis-cache:metrics 0 9999999999 WITHSCORES
Could you run that?
I believe this is a multisite issue and I’ll include a fix in the next version.
One last thing, I assume the “Metrics” charts are just empty, or do they say anything in particular?
Hey listen, I just found something that can be very helpful to solve this problem.
My WP installation uses the PT_BR as default language, in my dev environment after updating plugins languages the chart stopped working, so i think it must be something related to this.
The “Metrics” charts say: “Ainda não foram coletados dados suficientes” which means “not enough data collected”
This is the output:
127.0.0.1:6379> zrangebyscore 1:redis-cache:metrics 0 9999999999 WITHSCORES 1) "i=114be45;h=60;m=20;r=75;b=544158;t=0.01267;c=35" 2) "1598354705" 3) "i=12ea929;h=3648;m=513;r=87.7;b=973132;t=0.16897;c=573" 4) "1598354706" 5) "i=137aa41;h=3776;m=66;r=98.3;b=945514;t=0.09888;c=214" 6) "1598354707" 7) "i=13ae5ae;h=3775;m=67;r=98.3;b=946055;t=0.10358;c=215" 8) "1598354707" 9) "i=1476d89;h=79;m=0;r=100;b=544957;t=0.01087;c=16" 10) "1598354708" 11) "i=17284f2;h=6065;m=2096;r=74.3;b=77677929;t=1.57443;c=2867" 12) "1598354711" 13) "i=17c0c48;h=79;m=0;r=100;b=544565;t=0.00755;c=16" 14) "1598354711" 15) "i=18119ef;h=79;m=0;r=100;b=544565;t=0.00926;c=16" 16) "1598354712" 17) "i=199b786;h=81796;m=36693;r=69;b=69422599;t=10.81144;c=37458" 18) "1598354713" 19) "i=1bdd201;h=79;m=0;r=100;b=544565;t=0.01127;c=16" 20) "1598354715" 21) "i=1cc8a7e;h=3765;m=67;r=98.3;b=945703;t=0.06100;c=215" 22) "1598354716" 23) "i=1d7553b;h=79;m=0;r=100;b=544565;t=0.00768;c=16" 24) "1598354717" 25) "i=1de5094;h=79;m=0;r=100;b=544565;t=0.00729;c=16" 26) "1598354717" 27) "i=1ebf2c5;h=3775;m=67;r=98.3;b=945703;t=0.05909;c=215" 28) "1598354718" 29) "i=1ee2c50;h=79;m=0;r=100;b=544565;t=0.00747;c=16" 30) "1598354718" 31) "i=1f2de01;h=3578;m=21;r=99.4;b=1284616;t=0.05740;c=176" 32) "1598354719" 33) "i=2059cc3;h=79;m=0;r=100;b=544565;t=0.00754;c=16" 34) "1598354720" 35) "i=22c9b57;h=3614;m=59;r=98.4;b=939610;t=0.06829;c=203" 36) "1598354722" 37) "i=23e83da;h=11763;m=4298;r=73.2;b=69157771;t=1.88142;c=4615" 38) "1598354723" 39) "i=24de83e;h=3787;m=66;r=98.3;b=945719;t=0.05492;c=217" 40) "1598354724" 41) "i=2518106;h=3482;m=42;r=98.8;b=931751;t=0.04675;c=185" 42) "1598354725" 43) "i=26323b2;h=1009;m=66;r=93.9;b=750625;t=0.02471;c=80" 44) "1598354726" 45) "i=26aaa1f;h=1097;m=15;r=98.7;b=924214;t=0.02445;c=60" 46) "1598354726" 47) "i=2b45ee8;h=3512;m=62;r=98.3;b=1265997;t=0.06799;c=211" 48) "1598354731" 49) "i=2be0439;h=79;m=0;r=100;b=545250;t=0.01019;c=16" 50) "1598354731" 51) "i=3029d26;h=5087;m=372;r=93.2;b=2571956;t=0.17852;c=611" 52) "1598354736" 53) "i=3077b7c;h=3464;m=26;r=99.3;b=1111422;t=0.05350;c=170" 54) "1598354736" 55) "i=32584f6;h=79;m=0;r=100;b=545250;t=0.00582;c=16" 56) "1598354738" 57) "i=32ec93a;h=79;m=0;r=100;b=545250;t=0.00776;c=16" 58) "1598354738" 59) "i=36b5193;h=3775;m=67;r=98.3;b=946388;t=0.05913;c=215" 60) "1598354742" 61) "i=383b7ca;h=3775;m=67;r=98.3;b=946388;t=0.04004;c=215" 62) "1598354744" 63) "i=398a9ae;h=3776;m=66;r=98.3;b=946392;t=0.05444;c=214" 64) "1598354745" 65) "i=3e3272b;h=1009;m=66;r=93.9;b=750625;t=0.02123;c=80" 66) "1598354750" 67) "i=3fe6150;h=79;m=0;r=100;b=545250;t=0.00751;c=16" 68) "1598354751" 69) "i=410faee;h=682;m=3;r=99.6;b=663159;t=0.01634;c=35" 70) "1598354753" 71) "i=4178cbd;h=3500;m=30;r=99.2;b=1113029;t=0.05354;c=177" 72) "1598354753" 73) "i=417bcc5;h=3776;m=66;r=98.3;b=946392;t=0.06426;c=214" 74) "1598354753" 75) "i=46d9e03;h=3776;m=66;r=98.3;b=946392;t=0.06428;c=214" 76) "1598354758"
Alright, that means metrics are being collected.
Are you seeing any JavaScript errors on your Dashboard or Redis Settings page?
Forget about translation, it’s working on my dev env with PT_BR translation now.
No javascript errors, that really weird problem.
Okay, we’re getting closer. Can you open your Redis Settings > Metrics and post the entire HTML source code of that page here? https://pastebin.com
Pasted here: https://pastebin.com/a2KAqpP3
Great, here is the issue:
<script id='redis-cache-js-extra'> var rediscache = {"jQuery":"jQuery","disable_pro":"","disable_banners":"","l10n":{"time":"Hora","bytes":"Bytes","ratio":"Taxa","calls":"Chamadas","no_data":"Ainda n\u00e3o foram coletados dados suficientes.","no_cache":"Ative o cache de objeto para coletar dados.","pro":"Object Cache Pro"}}; var rediscache_metrics = []; </script> <script src='https://dev.local/app/plugins/redis-cache/assets/js/admin.js?ver=2.0.12' id='redis-cache-js'></script> <script src='https://dev.local/app/plugins/redis-cache/assets/js/apexcharts.min.js?ver=2.0.12' id='redis-cache-charts-js'></script>
The related code:
https://github.com/rhubarbgroup/redis-cache/blob/765d2dcc58a2646816a90ad2e7729b8353955101/includes/class-plugin.php#L341-L352Are you seeing any errors in your logs?
If not, I’m guessing we should make the metrics network-wide, @naxvog?
- The topic ‘Metrics empty’ is closed to new replies.