-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature/83 :: Cache Statistics #127
Conversation
…n a future version of WP.
Reviewed. Wow, lots of work on this--awesome! I didn't catch any "obvious brain farts", but I'd love to run a lot more tests on this when ready. :-) Also, I haven't looked at what you've done so far, but as I was looking through the code and the various types of stats you're keeping, I realized it would be really cool if there was a graphical chart of some sort right at the top of the Options Panel (and/or available as a Dashboard admin widget!) that showed the cache stats--that would be awesome. :-) |
New Features
New Config. Options
Enhanced Features
Bugs Fixed
Compatibility
|
This is ready for another pair of eyes. |
Options related to stats collection that are not yet configurable from the UI, but could be modified via filters if necessary. Referencing this file.
|
@jaswsinc Woohoo! Thanks! Lots to review here. I'll get started on that as soon as the Next Release is pushed out (later today). One question I had that was not answered via the screenshots: What do the colors in the pie chart mean? What exactly is the pie chart showing? The pie chart seems really confusing and non-obvious to me for some reason. |
@jaswsinc I'm thinking the problem here may be that a pie chart is the wrong type of chart for the data being compared. If my assumption is correct and what the pie chart is representing in your screenshots is the varying average sizes of cache files on the disk, then what we should be using is a bar chart instead. The general consensus on when to use a pie chart and when to use a bar chart, from this section on Wikipedia:
Notice how in the example below, a bar chart is far easier to read because the variation between each thing being plotted varies so little: |
These are Polar Area charts. They are a lot like pie charts. For further details, see: http://www.chartjs.org/docs/#polar-area-chart-introduction The chart is interactive and animated. Tooltips help explain what the colors indicate. |
Ah, that makes things a bit more clear. So I guess what's missing is a simple legend that explains what each color represents. |
Customizing the Admin Bar ChartSee this line. You can save that file as For a pie chart, change this line: chartA = new Chart($chartA[0].getContext('2d')).PolarArea(chartAData, chartAOptions); To: chartA = new Chart($chartA[0].getContext('2d')).Pie(chartAData, chartAOptions); Chart.js also supports bar charts if you like those better. However, using the bar chart will require some other changes in the JS in terms of how the JSON data is built. Not a huge deal, so if you really prefer a bar chart that's doable. I played with each of them a little bit. |
Yeah. This is a tricky thing to chart, because what we really want to show (IMO), is the size of the cache in comparison to what a full cache looks like. That's going to give a site owner the best representation of what's actually in the cache, and how the current size of the cache compares to what a full cache looks like. To clarify, the current chart shows several things:
The challenges here, include:
|
It's interesting to hear your take on what's important with regards to charts / cache statistics. While I agree with most of what you said, I have a slightly different take on it. As a site owner myself, I wouldn't find much value in seeing something that attempts to show how close to a "full cache" I currently have. Instead, I would be more interested in a line graph that gives me a historical perspective of the number of files in my cache, with separate line graphs for each type of cache (page cache, HTML Compressor, OPcache, etc.). Why would that be more helpful to me? because it immediately gives me a sense of what my cache looks line on average and tells me where I am right now in relation to that average, which immediately tells me roughly how much of my site is currently cached. Numbers on the vertical axis of the line graph (e.g., 10, 100, 250, 500, 1000, 2500, 5000) would help me immediately see that there are roughly X number of, for example, "page cache" cache files. That would, in turn, tell me as a site owner, as someone who already knows how many Posts/Pages there are on my site (as most site owners likely would), that roughly X% of my site has been cached. For example, I know that I have 1,752 Posts on my personal site, and roughly a dozen or so Pages. I know that I have Logged-In User Caching disabled and 404 Caching disabled and that I'm forcing HTTPS on all pages. So if when looking at the ZenCache Cache Statistics Line Graph, I see that there are, on average 1,500 "page cache" cache files, that gives me a pretty good sense that most of my site has been cached. So, now that I've written those thoughts down, it sounds like you and I have the same idea but that I'm picturing something that's easier to graph against time and get a sense of the changes over time... something like I'd expect to see on Google Analytics. |
I just realized that the "page cache" number would contain Category and Term archive cache files as well, which would make comparing the "page cache" cache file number to the number of Posts/Pages on the site rather irrelevant. |
Totally agree. My comments were within the realm of what was possible at the moment; i.e., inside the box of what I was attempting to accomplish here--which started as just getting some basic stats into the admin bar so a site owner could take a quick look before clearing or wiping. I love the idea of collecting a better history and producing new charts/graphs. Totally doable. I would love to see a line chart (and other types of charts or options) that allow me to look at a history; i.e., charts based on time, not just on current size. My suggestion is that you post your thoughts on this in another GitHub issue so we can take a look at enhancing stats collection by storing data in a DB table of its own. The stats that we collect at the moment are transient. They expire after 30 days. They are stuffed into the metadata structure. If we are going to collect stats for analysis over time we should build a DB table and keep them for a much longer period of time then too. |
In a future release (as these are enhanced over time) we could give site owners a choice of chart types to choose from, and let them pick which chart(s) to display in the admin bar. |
I just wanted to comment again on the fact that features like this are really important in my view. Anything graphical that we can use in marketing material for a plugin that is largely a behind-the-scenes sort of application, is great. This new feature in the admin bar is huge selling point IMO, when you compare to other plugins where there is very little in the way of any graphical representation. |
Fantastic! I can't wait to see this in the official copy. That's great!!
I noticed this also on a test site earlier today. I think it could be caused by a rounding issue in the Chart.js library. I will play around with it a bit and see if I can avoid it by rounding the scale up just a bit to account for this. Referencing my code here: https://github.com/websharks/zencache-pro/blob/feature/68/src/client-s/js/admin-bar.js#L270-L292 |
Addressing the following issues:
bourbon
(Sass extension).Darken when hovered to indicate a subtle mode change.
enqueueMainNotice()
for main site only.*_option()
in favor of*_site_option()
*_site_option()
exclusively moving forward.zencache_errors
option key on next upgrade.No longer needed after
NoticeUtils.php
refactor.fromLte150807()
version-specific upgrade handler.Continuing work...
cleanupCache()
method to give the CRON cleanup a method of its own.zc-
prefixed files usingSHORT_NAME
for easier branding.wurgeCache()
andautoWurgeCache()
for global cache purging.This branch includes changes from
feature/jaswsinc
also.