9 Replies - 2623 Views - Last Post: 13 May 2011 - 09:50 AM Rate Topic: -----

#1 haseeeb   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-May 11

how to detect if process is slow not hung

Posted 13 May 2011 - 06:46 AM

I have application work under cmd and Java.exe process
the application is working and check java process is working
but sometimes the process is not hang but very slow
how can i detect if the process is slow work
and i will make restart for process please help me
Is This A Good Question/Topic? 0
  • +

Replies To: how to detect if process is slow not hung

#2 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6535
  • View blog
  • Posts: 14,450
  • Joined: 02-June 10

Re: how to detect if process is slow not hung

Posted 13 May 2011 - 06:57 AM

If it reports it's progress (raises an event) with each loop, or step etc. then you can time how long between reported events.

It would be up to you to decide the timeout, after which you would consider it hung-up.
Was This Post Helpful? 0
  • +
  • -

#3 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5106
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: how to detect if process is slow not hung

Posted 13 May 2011 - 07:07 AM

I'm afraid that without more information, tlhIn`toq's answer is the only valid one. We need to know more about what the application does to give advice. If it reports progress, then absolutely, that's the way to handle it. If not, then you'd have to observe some real effect the application has.

For example, is it doing File IO? If so, you can watch the folder and time how long it takes the file to grow or shrink or be created, etc. Database IO? Have a process watch the DB.

The idea is, what measurable effects does your program have on the environment it's in?
Was This Post Helpful? 0
  • +
  • -

#4 haseeeb   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-May 11

Re: how to detect if process is slow not hung

Posted 13 May 2011 - 07:20 AM

I have network and database for ID card and when the request is much some times the application who is compare between face picture and fingerprint from database is like hang but not hang
and when i restart application it is work faster and complete the tickets from file
i want to do program on c# .net to watch this process or application when the work is slow
and the data on source file is be more refrsh process or start it
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15260
  • View blog
  • Posts: 61,138
  • Joined: 12-June 08

Re: how to detect if process is slow not hung

Posted 13 May 2011 - 07:27 AM

Personally this sounds like you are attempting to fix the symptom, not the problem. If the application is getting bogged down with leaks and unreleased resources it sounds like you should look into that instead of automating its reboot. This this id/fingerprint system something you wrote?
Was This Post Helpful? 0
  • +
  • -

#6 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5106
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: how to detect if process is slow not hung

Posted 13 May 2011 - 07:31 AM

Well, as eclipsed4utoo mentioned in this post, you can use a SqlDependency to catch changes to a database. I'd write an application to time it, and report the time difference between update/inserts/whatever, over time, and write out that data. Then you can analyze it and decide what the longest threshold you want to allow is. Then, you can change the application to kick off a timer each time a DB transaction happens. Restart the timer every time a transaction happens. If long enough goes between transactions, the timer should kill and restart the process.
Was This Post Helpful? 0
  • +
  • -

#7 haseeeb   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-May 11

Re: how to detect if process is slow not hung

Posted 13 May 2011 - 09:03 AM

Thanks for all
but is there are a c# command for mesurement a speed of process
or speed of application that make some processes on file
like recieve some data and processing it after that send it to another application
on another server on network
I mean i want to monitor the process
because my network is in another building and when we have problem
i check applications on all servers with remote desktop
i want to build application to monitor all applications on all server
from my applecation

This post has been edited by haseeeb: 13 May 2011 - 09:07 AM

Was This Post Helpful? 0
  • +
  • -

#8 Ionut   User is offline

  • D.I.C Lover
  • member icon

Reputation: 386
  • View blog
  • Posts: 1,057
  • Joined: 17-July 10

Re: how to detect if process is slow not hung

Posted 13 May 2011 - 09:10 AM

Did you check this link from MSDN?
Was This Post Helpful? 0
  • +
  • -

#9 Curtis Rutland   User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 5106
  • View blog
  • Posts: 9,283
  • Joined: 08-June 10

Re: how to detect if process is slow not hung

Posted 13 May 2011 - 09:41 AM

You can get all the information that is shown in the Task Manager, and even more, but there's really no such thing as "speed of the process."

I mean, sure, you can get the amount of memory it's using, the bytes read/written to disk, the % utilization of the processor, etc...but you have to know how to interpret that information. You have to be able to quantify rules. There's no single way to say "is this process going slowly."
Was This Post Helpful? 0
  • +
  • -

#10 haseeeb   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 03-May 11

Re: how to detect if process is slow not hung

Posted 13 May 2011 - 09:50 AM

Thanks for All
you mean i must take more than one arguments to deside the process is slow or no
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1