monitoring

How to monitor Java memory usage?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 04:38:01
问题 We have a j2ee application running on Jboss and we want to monitor its memory usage. Currently we use the following code System.gc(); Runtime rt = Runtime.getRuntime(); long usedMB = (rt.totalMemory() - rt.freeMemory()) / 1024 / 1024; logger.information(this, \"memory usage\" + usedMB); This code works fine. That means it shows memory curve which corresponds to reality. When we create a big xml file from a DB a curve goes up, after the extraction is finished it goes down. A consultant told us

How can I view live MySQL queries?

我是研究僧i 提交于 2019-11-26 03:46:17
问题 How can I trace MySQL queries on my Linux server as they happen? For example I\'d love to set up some sort of listener, then request a web page and view all of the queries the engine executed, or just view all of the queries being run on a production server. How can I do this? 回答1: You can run the MySQL command SHOW FULL PROCESSLIST; to see what queries are being processed at any given time, but that probably won't achieve what you're hoping for. The best method to get a history without

Monitoring contents of files/directories? [duplicate]

被刻印的时光 ゝ 提交于 2019-11-26 02:19:12
问题 This question already has answers here : How do I watch a file for changes? (23 answers) Closed 6 years ago . I\'m looking for a cross-platform file monitoring python package? I know it is possible to monitor files on windows using pywin32, and there are packages working on Linux/Unix but does anyone know about a cross-platform one? 回答1: For Unix/Linux based systems, you should use File Alteration Monitor Python bindings to libfam. For Windows based systems, you should tie into the Win32 API

How to monitor SQL Server table changes by using c#?

假如想象 提交于 2019-11-26 01:41:56
问题 I have more than one application accessing the same DB and I need to get notified if one of these apps change anything (update, insert) in a certain table. Database and apps are not in the same server. 回答1: You can use the SqlDependency Class. Its intended use is mostly for ASP.NET pages (low number of client notifications). ALTER DATABASE UrDb SET ENABLE_BROKER Implement the OnChange event to get notified: void OnChange(object sender, SqlNotificationEventArgs e) And in code: SqlCommand cmd =

How to activate JMX on my JVM for access with jconsole?

ぃ、小莉子 提交于 2019-11-26 01:10:00
问题 How to activate JMX on a JVM for access with jconsole? 回答1: The relevant documentation can be found here: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html Start your program with following parameters: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.rmi.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false For instance

How do I make my program watch for file modification in C++?

感情迁移 提交于 2019-11-26 01:05:32
问题 There are a lot of programs, Visual Studio for instance, that can detect when an outside program modifies a file and then reload the file if the user wants chooses. Is there a relatively easy way to do this sort of thing in C++ (doesn\'t necessarily have to be platform independent)? 回答1: There are several ways to do this depending on the platform. I would choose from the following choices: Cross Platform Trolltech's Qt has an object called QFileSystemWatcher which allows you to monitor files

How to monitor SQL Server table changes by using c#?

六眼飞鱼酱① 提交于 2019-11-25 18:52:23
I have more than one application accessing the same DB and I need to get notified if one of these apps change anything (update, insert) in a certain table. Database and apps are not in the same server. You can use the SqlDependency Class . Its intended use is mostly for ASP.NET pages (low number of client notifications). ALTER DATABASE UrDb SET ENABLE_BROKER Implement the OnChange event to get notified: void OnChange(object sender, SqlNotificationEventArgs e) And in code: SqlCommand cmd = ... cmd.Notification = null; SqlDependency dependency = new SqlDependency(cmd); dependency.OnChange +=