File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 2727
2828@data_source_generator (name = "Memory Usage" )
2929def memory_usage_data_source ():
30- yield ("Memory/Physical" , physical_memory_used ())
31- yield ("Memory/Physical/%d" % (PID ), physical_memory_used ())
32-
33- yield (
34- "Memory/Physical/Utilization" ,
35- physical_memory_used () / total_physical_memory (),
36- )
37- yield (
38- "Memory/Physical/Utilization/%d" % (PID ),
39- physical_memory_used () / total_physical_memory (),
30+ memory = physical_memory_used ()
31+ total_memory = total_physical_memory ()
32+ memory_utilization = (
33+ (memory / total_memory ) if None not in (memory , total_memory ) else None
4034 )
35+
36+ yield ("Memory/Physical" , memory )
37+ yield ("Memory/Physical/%d" % (PID ), memory )
38+
39+ yield ("Memory/Physical/Utilization" , memory_utilization )
40+ yield ("Memory/Physical/Utilization/%d" % (PID ), memory_utilization )
You can’t perform that action at this time.
0 commit comments