diagnostics

Process Memory Size - Different Counters

I'm trying to find out how much memory my own .Net server process is using (for monitoring and logging purposes). I'm using: Process.GetCurrentProcess().PrivateMemorySize64 However, the Process object has several different properties that let me read the memory space used: Paged, NonPaged, PagedSystem, NonPagedSystem, Private, Virtua...

Diagnosing application hang in a production .NET desktop program

I have trouble. One of the users of an application I'm developing is occasionally, but regularly, experiencing an application hang. When this happens, we find an entry with a source of "Application Hang" in the machine's Event Log, with the informative message "Hanging application [my app], version [the right version], hang module hung...

Get SQL Server Connection info from app without debugging?

We are troubleshooting a SQL Server 2005 connection issue on a closed-source third-party ASP.NET application. The application is a .NET application and the developing company is using a custom formatted configuration file that stores the SQL Server authentication information. The application when trying to connect to our SQL Server box...

CompositeData has no keys() method?

I'm using JMX to save some diagnostic information from a remote process. Looking at the interface in jconsole shows that the return type is CompositeData (the data actually comes back as CompositeDataSupport). I want to output all the key/value pairs that are associated with this object. The problem is that the interface just seems to h...

Can you get a list of variables on the stack in C#?

All, just wondering if it's possible in .NET/C# to get a list of variables on the stack and their values? I am creating an exception handler for my app and beyond a standard stack trace I'd also like to see the names and values for any variables that are on the stack. Any idea if this can be done? ...

Getting process information in .NET

Duplicate of this question. update - This is not an exact duplicate. See my solution. I see a java.exe process in process explorer, and double clicking it gives me its working directory & starting command line arguments. From .NET, I run the following code and get a process with the same PID but the above fields are empty. Apparently,...

C# runtime application Diagnostics

I am developing a c# GUI and was wondering if there were any (preferably free) runtime diagnostic programs available. What Im looking for is a way to monitor user interactions with my GUI and what functions are called when. Preferably I do not want to add stacks of debug code as this has the potential to change the behaviour of the bug...

How to read command line arguments of another process in C#?

How can I obtain the command line arguments of another process? Using static functions of the System.Diagnostics.Process class I can obtain a list of running processes, e.g. by name: Process[] processList = Process.GetProcessesByName(processName); However, there is no way to access the command line used to start this process. How wo...

How to translate MS Windows OS version numbers into product names in .NET?

How to translate MS Windows OS version numbers into product names? For example, in .NET the following two properties could be used to work out that the product is MS Windows Vista Ultimate Edition : Environment.OSVersion.Platform returns Win32NT Environment.OSVersion.Version returns 6.0.6001.65536 ...

log4net versus TraceSource

In this thread many people have indicated that they use log4net. I am a fan of TraceSources and would like to know why log4net is used. Here is why I like trace sources: Pluggable listeners - XML, TextFile, Console, EventLog, roll your own Customisable trace switches (error, warning, info, verbose, start, end, custom) Customisable co...

what is considered average request processing time?

What is normal time range for request processing? ...

How can I list all processes running in Windows?

Hello world. I would like to find a way to loop through all the active processes and do diagnostics checks on them (mem usage, cpu time etc) kinda similar to the task manager. The problem is broken down into two parts: Finding all the processes Finding diagnostics attributes about them I am not sure even in what namespace to go lo...

What should I display in my About box?

I've built a small .NET winforms utility for internal use at my company, and as the primary interface is a tab control, I've decided to add a tab for the "about box" instead of a separate form. So, I have some space to fill in my about box. Thus far I have: the program's icon & name version the author's name (me) the year of creation ...

Where should I put a project- or application-wide TraceSwitch in my design?

Hi, I'm trying to enhance my program with some logging functionality provided by System.Diagnostics. As my Solution consists of several projects, I wanted to create a switch for the whole application and one for every project. Now the question is, how can I achieve this and where should I put the switch definition? Starting with the a...

Is it possible to get parameters' values for each frame in call stack in .NET

I'm talking about managed .NET code. If we run any program and attach VS to it we can see parameters' values for each method in call stack. I'd like to create a logging solution which will log all parameters' values for each method in call stack. Actually I need this info in case an exception occurs. I know it's possible with profiling ...

Overriding System.Diagnostics.Trace.WriteLine to log to a file

This may be more of an OOP concept question, but here's what I'd like to do. I have an application that outputs debug information using System.Diagnostics.Trace.WriteLine so it can be viewed with DebugView. I'd like to override/extend (not sure of the proper terminology) this method to log the text to a file instead, or maybe in additi...

Is there any API for getting start time of a APACHE WebServer?

I am writing a small application to get the various diagnostic parameter of Apache Webserver like time of the start of the server, Worker mode or Prefork mode, server version and many more. I have found few API for getting info about these parameter. But I colud not find nay API for the getting start time of the WebServer. Is there any s...

Fault Diagnostic Process

Has anyone created or seen a good fault diagnostic procedure for a web based solutions that an Operations team could use to do diagnostic and support with? The solution is based on a C# system running on IIS and making use of things like workflow and WCF services. It's a Service Based solution and also makes use of external and Internal...

Why does the second for loop always execute faster than the first one?

I was trying to figure out if a for loop was faster than a foreach loop and was using the System.Diagnostics classes to time the task. While running the test I noticed that which ever loop I put first always executes slower then the last one. Can someone please tell me why this is happening? My code is below: using System; using System....

SQL connection failure and network reliability

Are there any tools to quickly test network reliability to a SQL server? We are receiving error reports from a particular customer who has a random "connection failure" message popup throughout the day. We have identified a few spots where this error might occur, but at different times of the day the code executes perfectly. Some other ...