File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -76,25 +76,33 @@ impl RecordReader for Topology {
76
76
// else return pkg + dram + F(disks)
77
77
78
78
if let Some ( psys_record) = self . get_rapl_psys_energy_microjoules ( ) {
79
+ debug ! ( "Using PSYS metric" ) ;
79
80
Ok ( psys_record)
80
81
} else {
81
82
let mut total: i128 = 0 ;
82
- debug ! ( "Suming socket metrics to get host metric" ) ;
83
+ debug ! ( "Suming socket PKG and DRAM metrics to get host metric" ) ;
83
84
for s in & self . sockets {
84
85
if let Ok ( r) = s. read_record ( ) {
85
86
match r. value . trim ( ) . parse :: < i128 > ( ) {
86
87
Ok ( val) => {
87
88
total += val;
88
89
} ,
89
90
Err ( e) => {
90
- debug ! ( "could'nt convert {} to i128: {}" , r. value, e) ;
91
+ warn ! ( "could'nt convert {} to i128: {}" , r. value. trim ( ) , e) ;
91
92
}
92
93
}
93
94
}
94
95
for d in & s. domains {
95
96
if d. name == "dram" {
96
97
if let Ok ( dr) = d. read_record ( ) {
97
- total = total + dr. value . parse :: < i128 > ( ) . unwrap ( )
98
+ match dr. value . trim ( ) . parse :: < i128 > ( ) {
99
+ Ok ( val) => {
100
+ total += val;
101
+ } ,
102
+ Err ( e) =>{
103
+ warn ! ( "could'nt convert {} to i128: {}" , dr. value. trim( ) , e) ;
104
+ }
105
+ }
98
106
}
99
107
}
100
108
}
You can’t perform that action at this time.
0 commit comments