Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Where convenient I've implemented some level of indirection, where inconvenient I've used platform checking to skip some Linux only code. Real code checking running processes and so on will be submitted in next changes. Change-Id: I5abb1b37621c295eac56ff096c5a348f999588c9 Partial-Bug: #1783539
- Loading branch information
Michal Clapinski
committed
Jul 26, 2018
1 parent
d9d8fdf
commit 1af9785
Showing
8 changed files
with
138 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved. | ||
# | ||
|
||
import time | ||
|
||
from windows_process_mem_cpu import WindowsProcessMemCpuUsageData | ||
|
||
class WindowsProcessInfoManager(object): | ||
def get_mem_cpu_usage_data(self, pid, last_cpu, last_time): | ||
return WindowsProcessMemCpuUsageData(pid, last_cpu, last_time) | ||
|
||
def get_all_processes(self): | ||
return [] | ||
|
||
def runforever(self): | ||
while True: | ||
time.sleep(5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# | ||
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved. | ||
# | ||
|
||
from sandesh.nodeinfo.cpuinfo.ttypes import ProcessCpuInfo | ||
|
||
class WindowsProcessMemCpuUsageData(object): | ||
def __init__(self, _id, last_cpu, last_time): | ||
self.last_cpu = last_cpu | ||
self.last_time = last_time | ||
self._id = hex(_id)[2:-1].zfill(64) | ||
|
||
def get_process_mem_cpu_info(self): | ||
process_mem_cpu = ProcessCpuInfo() | ||
return process_mem_cpu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved. | ||
# | ||
|
||
from sandesh.nodeinfo.cpuinfo.ttypes import SysMemInfo, SysCpuInfo | ||
|
||
class WindowsSysMemCpuUsageData(object): | ||
def __init__(self, last_cpu, last_time): | ||
self.last_cpu = last_cpu | ||
self.last_time = last_time | ||
|
||
def get_num_socket(self): | ||
return 0 | ||
|
||
def get_num_cpu(self): | ||
return 0 | ||
|
||
def get_num_core_per_socket(self): | ||
return 0 | ||
|
||
def get_num_thread_per_core(self): | ||
return 0 | ||
|
||
def get_sys_mem_info(self, node_type): | ||
sys_mem_info = SysMemInfo() | ||
return sys_mem_info | ||
|
||
def get_sys_cpu_info(self, node_type): | ||
sys_cpu_info = SysCpuInfo() | ||
return sys_cpu_info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters