@@ -256,8 +256,8 @@ impl Nexus {
256
256
"n_producers" => producers. len( ) ,
257
257
"collector_id" => ?oximeter_info. collector_id,
258
258
) ;
259
- let ( client, _ ) = self . build_oximeter_client (
260
- oximeter_info. collector_id ,
259
+ let client = self . build_oximeter_client (
260
+ & oximeter_info. collector_id ,
261
261
oximeter_info. address ,
262
262
) ;
263
263
for producer in producers. into_iter ( ) {
@@ -316,26 +316,13 @@ impl Nexus {
316
316
. expect ( "expected an infinite retry loop registering nexus as a metric producer" ) ;
317
317
}
318
318
319
- /// Return a client to the Oximeter instance with the given ID.
320
- pub async fn oximeter_client (
321
- & self ,
322
- id : Uuid ,
323
- ) -> Result < ( OximeterClient , Uuid ) , Error > {
324
- let oximeter_info = self . db_datastore . oximeter_fetch ( id) . await ?;
325
- let address = SocketAddr :: new (
326
- oximeter_info. ip . ip ( ) ,
327
- oximeter_info. port . try_into ( ) . unwrap ( ) ,
328
- ) ;
329
- Ok ( self . build_oximeter_client ( oximeter_info. id , address) )
330
- }
331
-
332
319
// Internal helper to build an Oximeter client from its ID and address (common data between
333
320
// model type and the API type).
334
321
fn build_oximeter_client (
335
322
& self ,
336
- id : Uuid ,
323
+ id : & Uuid ,
337
324
address : SocketAddr ,
338
- ) -> ( OximeterClient , Uuid ) {
325
+ ) -> OximeterClient {
339
326
let client_log =
340
327
self . log . new ( o ! ( "oximeter-collector" => id. to_string( ) ) ) ;
341
328
let client =
@@ -345,7 +332,7 @@ impl Nexus {
345
332
"registered oximeter collector client" ;
346
333
"id" => id. to_string( ) ,
347
334
) ;
348
- ( client, id )
335
+ client
349
336
}
350
337
351
338
/**
@@ -2142,7 +2129,8 @@ impl Nexus {
2142
2129
} ) ?;
2143
2130
let address =
2144
2131
SocketAddr :: from ( ( info. ip . ip ( ) , info. port . try_into ( ) . unwrap ( ) ) ) ;
2145
- Ok ( self . build_oximeter_client ( info. id , address) )
2132
+ let id = info. id ;
2133
+ Ok ( ( self . build_oximeter_client ( & id, address) , id) )
2146
2134
}
2147
2135
2148
2136
pub async fn session_fetch (
0 commit comments