Comments (13)
@lkraav See https://github.com/johnbillion/query-monitor/tree/json-output. In this branch, QM outputs a qm_json
object too. It can, for example, be queried in your browser console with something like qm_json.db_queries.times['get_option()'].calls
.
See the commit at cd1bd85 for which files you'll want to start hacking for your own needs.
from query-monitor.
Reactions ^^^^
from query-monitor.
Yes! I'd love to see this log to syslog/error_log, or even provide JSON output for automation cases. Time and time again, I'll see themes that break the HTML output, and so I've got to manually view the output through raw HTML (which isn't very fun at all).
from query-monitor.
Closing this as fixed. I'm going to open up follow-up issues for further work.
from query-monitor.
Query Monitor 2.6 has greatly increased abstraction. Output is now handled in separate classes from the data collection, which goes a long way to facilitating other methods of output as described above.
More to come, but this is the majority of it.
from query-monitor.
Marking this as complete. The data collection is sufficiently abstracted from the output now. I'm going to work on a persistent log at some point, but it's not too high on my priority list currently.
from query-monitor.
Any news on the persistent logging? Do I have to get my hands dirty or have you made progress already? 😄
from query-monitor.
@FabianSperrle It's in the pipeline, but no, there's nothing ready yet.
If you want to get your hands a little dirty, there's a very rough and ready implementation in the logger branch which I knocked up ages ago when I needed it. It logs some output to error_log()
. Not ideal but handy if you really need it. Also take note of this.
from query-monitor.
I'm also looking for JSON format output, to automagically send a subset of performance data to outside analytics tools - let's say Google Analytics events for the simplest example.
It doesn't look like this moved a whole lot, so wondering what could be the next step here? How massive is the workload here I wonder? If there was a $$$ bounty on it, how much would someone take this on for?
from query-monitor.
@lkraav This would be relatively simple to implement, the only problem would be that QM still logs some large objects in three places (hooks, JS & CSS, and backtraces).
I'll push some code later this evening that demonstrates how to write an output dispatcher without having to handle every different data collector in QM.
from query-monitor.
@johnbillion the branch has an initial state of outputting var qm_json = ;
syntax error, which looks like $out
isn't getting populated correctly for some reason. Is this normal or?
from query-monitor.
Not quite sure what's going on there. Try reloading the page and the qm_json
variable should be correctly populated.
from query-monitor.
Not quite sure what's going on there. Try reloading the page and the qm_json variable should be correctly populated.
@johnbillion I'm not able to get the object to show up. Perhaps backtracing the output is the next step, but this isn't showing anything meaningful.
1 .../wp-includes/plugin.php:525QM_Dispatcher_JSON->dispatch(#1)
2 .../wp-includes/load.php:638do_action(tag)
3 PHP internal callshutdown_action_hook()
→ Called from .../query-monitor.git/dispatchers/JSON.php:46 [QM_Dispatcher_JSON->dispatch()]
from query-monitor.
Related Issues (20)
- Feature Request: Click to Copy for log messages HOT 4
- Query Monitor triggers infinite loop via `locale` filter when handling `_doing_it_wrong` notices HOT 4
- PHP Fatal Error HOT 5
- Link under Profile and Timings 404s HOT 4
- AJAX errors in console regarding null post HOT 2
- Add support for the Modules API
- QM Drop-in issue with WP All Import plugin HOT 3
- Logs panel: broken link HOT 2
- WordPress 6.5: Support new `load_translation_file` filter HOT 2
- 403 Forbidden on self GET wp-admin HOT 2
- Broken links HOT 3
- Interference with W3 Total Cache due to "db.php" HOT 2
- Show template parts that were not loaded via the `core/template-part` block type
- vulnerability management HOT 1
- Problem w/ the auto-loader in 3.16.0 HOT 11
- 3.16 throws critical error HOT 1
- Fatal Error when running alongside RedisCachePro HOT 4
- QM not triggering on front end
- RCA of the 3.16.0 release HOT 2
- PHP Warning: Undefined array key (probably Windows-only issue) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from query-monitor.