summaryrefslogtreecommitdiff
path: root/runtime/metrics.rs
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-05-06 19:32:03 +0200
committerGitHub <noreply@github.com>2021-05-06 19:32:03 +0200
commit1e8e44f4c31688ac55100f96bdab27723eb6e575 (patch)
tree820c3b61ded766ecb912eefddaae4894e399555c /runtime/metrics.rs
parentf208e6a26f3c21c25dbfcfe29491a6f5660c999d (diff)
refactor(ops): replace `ZeroCopyBuf` arg by 2nd generic deserializable arg (#10448)
Diffstat (limited to 'runtime/metrics.rs')
-rw-r--r--runtime/metrics.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/runtime/metrics.rs b/runtime/metrics.rs
index f3f48e55e..46e966fae 100644
--- a/runtime/metrics.rs
+++ b/runtime/metrics.rs
@@ -150,7 +150,7 @@ use deno_core::OpFn;
use std::collections::HashMap;
pub fn metrics_op(name: &'static str, op_fn: Box<OpFn>) -> Box<OpFn> {
- Box::new(move |op_state, payload, buf| -> Op {
+ Box::new(move |op_state, payload| -> Op {
// TODOs:
// * The 'bytes' metrics seem pretty useless, especially now that the
// distinction between 'control' and 'data' buffers has become blurry.
@@ -160,12 +160,9 @@ pub fn metrics_op(name: &'static str, op_fn: Box<OpFn>) -> Box<OpFn> {
// TODO: remove this, doesn't make a ton of sense
let bytes_sent_control = 0;
- let bytes_sent_data = match buf {
- Some(ref b) => b.len(),
- None => 0,
- };
+ let bytes_sent_data = 0;
- let op = (op_fn)(op_state.clone(), payload, buf);
+ let op = (op_fn)(op_state.clone(), payload);
let op_state_ = op_state.clone();
let mut s = op_state.borrow_mut();
@@ -181,9 +178,9 @@ pub fn metrics_op(name: &'static str, op_fn: Box<OpFn>) -> Box<OpFn> {
use deno_core::futures::future::FutureExt;
match op {
- Op::Sync(buf) => {
+ Op::Sync(result) => {
metrics.op_sync(bytes_sent_control, bytes_sent_data, 0);
- Op::Sync(buf)
+ Op::Sync(result)
}
Op::Async(fut) => {
metrics.op_dispatched_async(bytes_sent_control, bytes_sent_data);