Skip to content

Commit ae7d97f

Browse files
committed
Instrument SimpleConnection::batch_execute as well
1 parent 130d228 commit ae7d97f

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/oracle/connection/mod.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,23 @@ unsafe impl Send for OciConnection {}
241241

242242
impl SimpleConnection for OciConnection {
243243
fn batch_execute(&mut self, query: &str) -> QueryResult<()> {
244-
self.raw.execute(query, &[]).map_err(ErrorHelper::from)?;
245-
Ok(())
244+
self.instrumentation
245+
.on_connection_event(InstrumentationEvent::start_query(
246+
&diesel::connection::StrQueryHelper::new(query),
247+
));
248+
let r = self
249+
.raw
250+
.execute(query, &[])
251+
.map_err(ErrorHelper::from)
252+
.map_err(Into::into)
253+
.map(|_| ());
254+
self.instrumentation
255+
.on_connection_event(InstrumentationEvent::finish_query(
256+
&diesel::connection::StrQueryHelper::new(query),
257+
r.as_ref().err(),
258+
));
259+
260+
r
246261
}
247262
}
248263

0 commit comments

Comments
 (0)