This repository was archived by the owner on Jul 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ class QueryManager {
115115 try {
116116 log ( 'query:start' )
117117 this . _queries ++
118- this . _metrics && this . _metrics . updateComponentMetric ( `kad-dht-${ this . _lan ? 'lan' : 'wan' } ` , METRIC_RUNNING_QUERIES , this . _queries )
118+ this . _metrics && this . _metrics . updateComponentMetric ( { component : `kad-dht-${ this . _lan ? 'lan' : 'wan' } ` , metric : METRIC_RUNNING_QUERIES , value : this . _queries } )
119119
120120 if ( peers . length === 0 ) {
121121 log . error ( 'Running query with no peers' )
@@ -161,7 +161,7 @@ class QueryManager {
161161 }
162162
163163 this . _queries --
164- this . _metrics && this . _metrics . updateComponentMetric ( `kad-dht-${ this . _lan ? 'lan' : 'wan' } ` , METRIC_RUNNING_QUERIES , this . _queries )
164+ this . _metrics && this . _metrics . updateComponentMetric ( { component : `kad-dht-${ this . _lan ? 'lan' : 'wan' } ` , metric : METRIC_RUNNING_QUERIES , value : this . _queries } )
165165
166166 cleanUp . emit ( 'cleanup' )
167167 log ( `query:done in ${ Date . now ( ) - ( startTime || 0 ) } ms` )
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ class RoutingTable {
118118 timeoutController . clear ( )
119119 }
120120
121- this . _metrics && this . _metrics . updateComponentMetric ( `kad-dht-${ this . _lan ? 'lan' : 'wan' } ` , METRIC_ROUTING_TABLE_SIZE , this . size )
121+ this . _metrics && this . _metrics . updateComponentMetric ( { component : `kad-dht-${ this . _lan ? 'lan' : 'wan' } ` , metric : METRIC_ROUTING_TABLE_SIZE , value : this . size } )
122122 }
123123 } )
124124 )
@@ -193,7 +193,7 @@ class RoutingTable {
193193
194194 this . _log ( 'added %p with kad id %b' , peer , id )
195195
196- this . _metrics && this . _metrics . updateComponentMetric ( `kad-dht-${ this . _lan ? 'lan' : 'wan' } ` , METRIC_ROUTING_TABLE_SIZE , this . size )
196+ this . _metrics && this . _metrics . updateComponentMetric ( { component : `kad-dht-${ this . _lan ? 'lan' : 'wan' } ` , metric : METRIC_ROUTING_TABLE_SIZE , value : this . size } )
197197 }
198198
199199 /**
@@ -206,7 +206,7 @@ class RoutingTable {
206206
207207 this . kb . remove ( id )
208208
209- this . _metrics && this . _metrics . updateComponentMetric ( `kad-dht-${ this . _lan ? 'lan' : 'wan' } ` , METRIC_ROUTING_TABLE_SIZE , this . size )
209+ this . _metrics && this . _metrics . updateComponentMetric ( { component : `kad-dht-${ this . _lan ? 'lan' : 'wan' } ` , metric : METRIC_ROUTING_TABLE_SIZE , value : this . size } )
210210 }
211211}
212212
Original file line number Diff line number Diff line change @@ -161,5 +161,5 @@ export interface Addressable {
161161}
162162
163163export interface Metrics {
164- updateComponentMetric : ( component : string , metric : string , value : number ) => void
164+ updateComponentMetric : ( options : { component : string , metric : string , value : number } ) => void
165165}
You can’t perform that action at this time.
0 commit comments