File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ export class LMDBStoreFactory implements DataStoreFactory {
148148 this . telemetry . registerGaugeProvider ( `store.${ name } .entries` , ( ) => stat . entries ) ;
149149 }
150150
151- this . telemetry . registerGaugeProvider ( 'total.usage' , ( ) => ( 100 * totalBytes ) / TotalMaxDbSize , {
151+ this . telemetry . registerGaugeProvider ( 'total.usage' , ( ) => 100 * ( totalBytes / TotalMaxDbSize ) , {
152152 unit : '%' ,
153153 } ) ;
154154 this . telemetry . registerGaugeProvider ( 'total.size' , ( ) => totalBytes , {
Original file line number Diff line number Diff line change @@ -102,10 +102,10 @@ export class TelemetryService implements Closeable {
102102 ) ;
103103
104104 telemetry . registerGaugeProvider (
105- 'process.memory.heap.usage_percent ' ,
105+ 'process.memory.heap.usage ' ,
106106 ( ) => {
107107 const usage = process . memoryUsage ( ) ;
108- return Math . round ( ( usage . heapUsed / usage . heapTotal ) * 100 ) ;
108+ return 100 * ( usage . heapUsed / usage . heapTotal ) ;
109109 } ,
110110 { unit : '%' } ,
111111 ) ;
@@ -127,7 +127,7 @@ export class TelemetryService implements Closeable {
127127
128128 if ( timeDiffMicros > 0 ) {
129129 const utilization = ( ( userDiff + systemDiff ) / timeDiffMicros ) * 100 ;
130- const clampedUtilization = Math . min ( Math . max ( Math . round ( utilization * 100 ) / 100 , 0 ) , 100 ) ;
130+ const clampedUtilization = Math . min ( Math . max ( utilization , 0 ) , 100 ) ;
131131
132132 lastCpuUsage = currentUsage ;
133133 lastTime = currentTime ;
You can’t perform that action at this time.
0 commit comments