monitor

Detect changes in directory

岁酱吖の 提交于 2019-12-06 16:22:00
I need to monitor a folder and its subdirectories for any file manipulations (add/remove/rename). I've read about FileSystemWatcher but I'd like to monitor changes between each time the program is run or when the user presses the "check for changes" button (FSW seems more orientated to runtime detection). My first thought was to iterate through all the (sub)directories and hash each file. Then, concatenate all the hashes (which have been ordered) and hash that. When I want to check for changes, I repeat the process and check if the hashes are the same. Is this an efficient way of doing it?

How can I Monitor cpu usage per thread of a java application in a linux multiprocessor environment?

杀马特。学长 韩版系。学妹 提交于 2019-12-06 15:42:17
I'm running a multithreaded java app in Linux RedHat 5.3 on a machine that has 8 cores (2 quad-core cpu's). I want to monitor the cpu usage of each thread, preferably relative to the maximal cpu it can get (a single thread running on 1 of the cores should go up to 100% and not 12.5%). Can I do it with jconsole/visualVM? Is there another (hopefully free) tool? Yoav If you don't want to use OS specific functions like traversing the /proc directory, you can usually get the values you're looking for from the Java management interface with ThreadMXBean.getThreadCpuTime() and ThreadMXBean

Python watchdog for another Python process technique?

 ̄綄美尐妖づ 提交于 2019-12-06 14:43:44
问题 I have a realtime data grabber that runs indefinitely, grabbing data over HTTP and putting it in a MySQL database every few seconds. In my program, I have a while True loop that spawns workers (functions that download the data and save it) whenever the last spawned time is greater than X seconds: while True: if _last_updated - datetime.now() > timedelta(seconds=5): green_pool.spawn_n(worker) # yes I'm using Eventlet! _last_updated = datetime.now() What would be the best way to ensure that

How to monitor my network connection with Java?

这一生的挚爱 提交于 2019-12-06 12:20:15
问题 Is there any sample code that can report the url that my PC is connecting with Java? While I use my browser to connect to different sites and watch video online, it should capture the urls. Is it doable in Java? I don't want detailed traffic, just record the urls. 回答1: The fastest way is probably going to be to capture the output of the command-line tshark program (for at least windows and linux). This works on my linux box: sudo tshark -f 'port 80' -R 'http' -V | grep -A 1 '^Hypertext

Is there any tool to detect code/functionality which is no longer used?

感情迁移 提交于 2019-12-06 07:48:17
We have many applications running (consider all of them run on Java Platform) and we need to check which ones were used in the last, say, 3 months, and, among those active applications, which parts/functionalities (and how often) are still being used. Is that possible? The goal here is to detect applications or funcionalities which no longer are relevant to the business and remove them, so that we end up having less code to maintain and monitor. Is there any tool which could help us achieving that? We DO use agile methods, so when a new application gets into production it has only the

monitor a log file with Get-Content -wait until the end of the day

别来无恙 提交于 2019-12-06 07:44:51
问题 I have a script monitoring a log file with get-Content and it waits for new lines to be written so it can detect the change. The logger changes the name of the log file every day to make it System_$date.log. I am trying to make my Get-Content to wait for new lines as well as break when the date changes then to re execute itself with the new date in the filename. Does anybody have an idea how this could be done? Thanks Edit The script looks like this: Get-Content System_201371.log -wait |

Why is a monitor implemented in terms of semaphores this way?

♀尐吖头ヾ 提交于 2019-12-06 07:26:39
问题 I have trouble understanding the implementation of a monitor in terms of semaphores from Operating System Concepts 5.8.3 Implementing a Monitor Using Semaphores We now consider a possible implementation of the monitor mechanism using semaphores. For each monitor, a semaphore mutex (initialized to 1) is provided. A process must execute wait(mutex) before entering the monitor and must execute signal(mutex) after leaving the monitor. Since a signaling process must wait until the resumed process

Idea: SVN monitor for pending commits?

放肆的年华 提交于 2019-12-06 05:17:30
I want to ask if somebody heard about a SVN monitoring tool for this case: in the past we used MS SourceSafe with checkout & lock mechanism to avoid merges. One benefit of this was the "release manager" can see in the repo whitch files are still not checked in. SVN is a great tool, but sometimes I miss this information, even to avoid big conflicts. Is there a monitoring system which can be used to see who has changed files pending for commiting? On every workstation a service/daemon collecting the modification information, sendig it periodcally to a central server and client apps to see the

Recent OpenHardwareMonitor Sample Code C#

≯℡__Kan透↙ 提交于 2019-12-06 04:00:00
问题 Does anybody know where I can find any recent samples for using OpenHardwareMonitor.dll in C#. I've tried a simple implementation but cannot get the cpu Temp. I know the library must have it since the app itself gets the temperature. I have a feeling you have to register events to get readings on certain things but I'm finding it difficult to find a good example. Computer myComputer = new Computer(); myComputer.Open(); foreach (var hardwareItem in myComputer.Hardware) { if (hardwareItem

Monitor.Pulse & Wait - Unexpected Behaviour

此生再无相见时 提交于 2019-12-05 10:46:17
http://www.codeproject.com/Articles/28785/Thread-synchronization-Wait-and-Pulse-demystified Queues: The ready queue is the collection of threads that are waiting for a particular lock. The Monitor.Wait methods introduce another queue: the waiting queue. This is required as waiting for a Pulse is distinct from waiting to acquire a lock. Like the ready queue, the waiting queue is FIFO. Recommended pattern: These queues can lead to unexpected behaviour. When a Pulse occurs, the head of the waiting queue is released and is added to the ready queue. However, if there are other threads in the ready