Skip to content

Commit

Permalink
Merge pull request #2422 from DataDog/greg/windows-swap
Browse files Browse the repository at this point in the history
[core] adds swap (pagefile) to windows stats
  • Loading branch information
gmmeyer committed Apr 29, 2016
2 parents 3ae5f9d + 82162d3 commit 22ff87c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions checks/system/win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ def __init__(self, logger):
# usable = free + cached
self.gauge('system.mem.usable')
self.gauge('system.mem.pct_usable')
# details about the usage of the pagefile.
self.gauge('system.mem.page_total')
self.gauge('system.mem.page_used')
self.gauge('system.mem.page_free')
self.gauge('system.mem.page_pct_free')

def check(self, agentConfig):
try:
Expand Down Expand Up @@ -182,6 +187,13 @@ def check(self, agentConfig):
pct_usable = float(usable) / total
self.save_sample('system.mem.pct_usable', pct_usable)

page = psutil.virtual_memory()
if page.total is not None:
self.save_sample('system.mem.page_total', page.total / B2MB)
self.save_sample('system.mem.page_used', page.used / B2MB)
self.save_sample('system.mem.page_free', page.available / B2MB)
self.save_sample('system.mem.page_pct_free', (100 - page.percent) / 100)

return self.get_metrics()


Expand Down

0 comments on commit 22ff87c

Please sign in to comment.