Skip to content

Commit 341ebf4

Browse files
authored
docs and remove Option (#58)
* docs and remove Option * lint
1 parent 35828a0 commit 341ebf4

File tree

4 files changed

+104
-39
lines changed

4 files changed

+104
-39
lines changed

src/client.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,12 @@ impl Client {
407407
}
408408

409409
// Report query executed statistics.
410-
self.stats.query(address.id);
410+
self.stats.query(self.process_id, address.id);
411411

412412
// The transaction is over, we can release the connection back to the pool.
413413
if !server.in_transaction() {
414414
// Report transaction executed statistics.
415-
self.stats.transaction(address.id);
415+
self.stats.transaction(self.process_id, address.id);
416416

417417
// Release server back to the pool if we are in transaction mode.
418418
// If we are in session mode, we keep the server until the client disconnects.
@@ -493,12 +493,12 @@ impl Client {
493493
}
494494

495495
// Report query executed statistics.
496-
self.stats.query(address.id);
496+
self.stats.query(self.process_id, address.id);
497497

498498
// Release server back to the pool if we are in transaction mode.
499499
// If we are in session mode, we keep the server until the client disconnects.
500500
if !server.in_transaction() {
501-
self.stats.transaction(address.id);
501+
self.stats.transaction(self.process_id, address.id);
502502

503503
if self.transaction_mode {
504504
self.stats.server_idle(server.process_id(), address.id);
@@ -532,7 +532,7 @@ impl Client {
532532
// Release server back to the pool if we are in transaction mode.
533533
// If we are in session mode, we keep the server until the client disconnects.
534534
if !server.in_transaction() {
535-
self.stats.transaction(address.id);
535+
self.stats.transaction(self.process_id, address.id);
536536

537537
if self.transaction_mode {
538538
self.stats.server_idle(server.process_id(), address.id);

src/pool.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl ConnectionPool {
234234
self.ban(address, shard);
235235
self.stats.client_disconnecting(process_id, address.id);
236236
self.stats
237-
.checkout_time(now.elapsed().as_micros(), address.id);
237+
.checkout_time(now.elapsed().as_micros(), process_id, address.id);
238238
continue;
239239
}
240240
};
@@ -255,7 +255,7 @@ impl ConnectionPool {
255255
Ok(res) => match res {
256256
Ok(_) => {
257257
self.stats
258-
.checkout_time(now.elapsed().as_micros(), address.id);
258+
.checkout_time(now.elapsed().as_micros(), process_id, address.id);
259259
self.stats.server_idle(conn.process_id(), address.id);
260260
return Ok((conn, address.clone()));
261261
}
@@ -267,7 +267,7 @@ impl ConnectionPool {
267267
self.ban(address, shard);
268268
self.stats.client_disconnecting(process_id, address.id);
269269
self.stats
270-
.checkout_time(now.elapsed().as_micros(), address.id);
270+
.checkout_time(now.elapsed().as_micros(), process_id, address.id);
271271
continue;
272272
}
273273
},
@@ -280,7 +280,7 @@ impl ConnectionPool {
280280
self.ban(address, shard);
281281
self.stats.client_disconnecting(process_id, address.id);
282282
self.stats
283-
.checkout_time(now.elapsed().as_micros(), address.id);
283+
.checkout_time(now.elapsed().as_micros(), process_id, address.id);
284284
continue;
285285
}
286286
}

src/server.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ impl Server {
268268

269269
/// Send messages to the server from the client.
270270
pub async fn send(&mut self, messages: BytesMut) -> Result<(), Error> {
271-
self.stats.data_sent(messages.len(), self.address.id);
271+
self.stats
272+
.data_sent(messages.len(), self.process_id, self.address.id);
272273

273274
match write_all_half(&mut self.write, messages).await {
274275
Ok(_) => Ok(()),
@@ -374,7 +375,8 @@ impl Server {
374375
let bytes = self.buffer.clone();
375376

376377
// Keep track of how much data we got from the server for stats.
377-
self.stats.data_received(bytes.len(), self.address.id);
378+
self.stats
379+
.data_received(bytes.len(), self.process_id, self.address.id);
378380

379381
// Clear the buffer for next query.
380382
self.buffer.clear();

0 commit comments

Comments
 (0)