Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How do I monitor bytes per second written or read from a directory (and sub-directories)?

How do I monitor bytes per second written or read from a directory (and sub-directories)?

Scheduled Pinned Locked Moved C#
questioncsharpdotnet
4 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bbranded
    wrote on last edited by
    #1

    Hello, I wish to monitor bytes per second written or read from a directory. Is something like this revealed by .NET framework, similar to that of FileSystemWatcher? I am attempting to monitor I/O to the DfsrPrivate folder to better understand the I/O of the dfsr.exe process. Thanks very much, Matt

    D 1 Reply Last reply
    0
    • B bbranded

      Hello, I wish to monitor bytes per second written or read from a directory. Is something like this revealed by .NET framework, similar to that of FileSystemWatcher? I am attempting to monitor I/O to the DfsrPrivate folder to better understand the I/O of the dfsr.exe process. Thanks very much, Matt

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You can't monitor I/O speed based on a folder. The best you're going to get is to/from the entire disk or the I/O statistics for a process. You'd use the PerformanceCounter[^] counter class and the appropriate performance counters to get the data you want.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      B 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You can't monitor I/O speed based on a folder. The best you're going to get is to/from the entire disk or the I/O statistics for a process. You'd use the PerformanceCounter[^] counter class and the appropriate performance counters to get the data you want.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        B Offline
        B Offline
        bbranded
        wrote on last edited by
        #3

        My work around is to use process monitor by the sysinternals dudes. Then parse the data. With the proper filters in place, the log ("backing file") grows about 4MB/minute; which is manageable. Process Monitor has a feature called File Summary (http://www.pcmag.com/slideshow_viewer/0,3253,l%253D248743%2526a%253D248736%2526po%253D13,00.asp?p=n[^]) which will summarize exactly what I want. Now, I guess the question is, how does Process Monitor gather this information? It's likely via the processes; monitoring the process's handles and where they are reading and writing. For me, this method, using Process Monitor, will do. However, it would still be interesting to investigate further ways to actually ways to grab the handles and identify their I/O. Thanks, Matt

        D 1 Reply Last reply
        0
        • B bbranded

          My work around is to use process monitor by the sysinternals dudes. Then parse the data. With the proper filters in place, the log ("backing file") grows about 4MB/minute; which is manageable. Process Monitor has a feature called File Summary (http://www.pcmag.com/slideshow_viewer/0,3253,l%253D248743%2526a%253D248736%2526po%253D13,00.asp?p=n[^]) which will summarize exactly what I want. Now, I guess the question is, how does Process Monitor gather this information? It's likely via the processes; monitoring the process's handles and where they are reading and writing. For me, this method, using Process Monitor, will do. However, it would still be interesting to investigate further ways to actually ways to grab the handles and identify their I/O. Thanks, Matt

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Process Monitor does it by sitting over the file system I/O functions. The technique is called API Hooking. PM hooks a lot of functions covering I/O, Registry, Process, ... It maintains a huge database that is populated with the API call data. It can give you all the details on a per-process basis quite easily.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups