In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to use sqlprofiler persistent dynamic monitoring framework in P6spy, the content is concise and easy to understand, it can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Basic usage:
1. Download p6spycopyright installjol zip from the home page, decompress it to get p6spy.jar and spy.properties.
2. Add two files to classpath
3. Modify the configuration file: hibernate.cfg.xml, and change the attribute of the session-factory element: value of hibernate.connection.driver_class to the jdbc driver class provided by p6spy:
Com.p6spy.engine.spy.P6SpyDriver
...
4. After completing the jdbc replacement in hibernate, we also need to configure (spy.properties) the p6spy to specify the underlying jdbc driver for actual operation: realdriver=com.mysql.jdbc.Driver
5. After sql is executed, the output result in the spy.log log is roughly as follows: 1109352762092 | 20 | 0 | statement | select user0_.id as _ id from user user0_, where the 20 in the second column is the time it takes to execute sql.
All sql execution is recorded in spy.log. To view graphical statistical results, you need to rely on the sql profiler tool.
Sql profiller download address: http://www.jahia.org
There are two main files: sqlprofiler.jar and spy.properties
Spy.properties is a sample configuration file for P6spy.
Sqlprofiler.jar is an executable jar package that can be run with the command: java-jar sqlprofiler.jar. It includes a user control interface for swing. If an OutOfMemory error is reported, start with the command line java-Xmx256m-jar sqlprofiler.jar.
1. After sqlprofiler starts, you will start listening to port 4445 of this machine.
2. P6spy sends log messages to sql profiler through log4j's SocketAppender
3. You can directly overwrite the spy.properties of p6spy with sql profiler's spy.properties, and then change the realdriver configuration to meet our actual situation.
The above is how to use the sqlprofiler persistence dynamic monitoring framework in P6spy. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.