monitoring

How to monitor Java memory usage?

混江龙づ霸主 提交于 2019-11-26 15:48:05
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 that calling gc() explicitly is wrong, "let jvm decide when to run gc". Basically his arguments were the

How can I view live MySQL queries?

余生长醉 提交于 2019-11-26 13:54:59
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? Chad Birch 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 having to modify every application using the server is probably through triggers. You could set up

Measuring Java execution time, memory usage and CPU load for a code segment

点点圈 提交于 2019-11-26 12:59:44
问题 For a particular segment of Java code, I\'d like to measure: Execution time (most likely thread execution time ) Memory usage CPU load (specifically attributable to the code segment) I\'m a relative Java novice and am not familiar with how this might be achieved. I\'ve been referred to JMX, however I\'m not sure how that might be used, and JMX looks a bit \'heavy\' for what I\'m looking to do. Ideally I\'d like some measurement class that can be told what I would like to measure, with the

Monitoring application calls to DLL

走远了吗. 提交于 2019-11-26 12:23:48
问题 In short: I want to monitor selected calls from an application to a DLL. We have an old VB6 application for which we lost the source code (the company wasn\'t using source control back then..). This application uses a 3rd party DLL. I want to use this DLL in a new C++ application. Unfortunately the DLL API is only partially documented, so I don\'t know how to call some functions. I do have the functions signature. Since the VB6 application uses this DLL, I want to see how it calls several

How to monitor a text file in realtime [closed]

≯℡__Kan透↙ 提交于 2019-11-26 12:03:43
问题 For debugging purposes in a somewhat closed system, I have to output text to a file. Does anyone know of a tool that runs on windows (console based or not) that detects changes to a file and outputs them in real-time? 回答1: Tail for Win32 Apache Chainsaw - used this with log4net logs, may require file to be in a certain format 回答2: I like tools that will perform more than one task, Notepad++ is a great notepad replacement and has a Document Monitor plugin (installs with standard msi) that

Monitoring contents of files/directories? [duplicate]

可紊 提交于 2019-11-26 11:14:19
This question already has an answer here: How do I watch a file for changes? 23 answers 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? Brian R. Bondy 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 FindFirstChangeNotification and related functions. As for a cross platform way, I don't know about a good cross

How can I monitor a Windows directory for changes?

混江龙づ霸主 提交于 2019-11-26 10:29:16
问题 When a change is made within a directory on a Windows system, I need a program to be notified immediately of the change. Is there some way of executing a program when a change occurs? I\'m not a C/C++/.NET programmer, so if I could set up something so that the change could trigger a batch file then that would be ideal. 回答1: Use a FileSystemWatcher like below to create a WatcherCreated Event(). I used this to create a Windows Service that watches a Network folder and then emails a specified

Monitor network activity in Android Phones

人走茶凉 提交于 2019-11-26 08:58:37
问题 I would like to monitor network traffic of my Android Phone. I was thinking using tcpdump for Android, but I\'m not sure if I have to cross-compile for the phone. Another question is the following, If I want to monitor the trafic data for a certain application, there\'s any command for doing that? 回答1: TCPDUMP is one of my favourite tools for analyzing network, but if you find difficult to cross-compile tcpdump for android, I'd recomend you to use some applications from the market. These are

Monitor network activity in Android Phones

烈酒焚心 提交于 2019-11-26 07:17:09
问题 I would like to monitor network traffic of my Android Phone. I was thinking using tcpdump for Android, but I\'m not sure if I have to cross-compile for the phone. Another question is the following, If I want to monitor the trafic data for a certain application, there\'s any command for doing that? 回答1: TCPDUMP is one of my favourite tools for analyzing network, but if you find difficult to cross-compile tcpdump for android, I'd recomend you to use some applications from the market. These are

Read from a log file as it's being written using python

若如初见. 提交于 2019-11-26 04:39:52
问题 I\'m trying to find a nice way to read a log file in real time using python. I\'d like to process lines from a log file one at a time as it is written. Somehow I need to keep trying to read the file until it is created and then continue to process lines until I terminate the process. Is there an appropriate way to do this? Thanks. 回答1: You could try with something like this: import time while 1: where = file.tell() line = file.readline() if not line: time.sleep(1) file.seek(where) else: print