diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-10-11 11:41:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-11 11:41:54 -0700 |
commit | 97d8498d46bbfb7bb16eeb3a69565d2aeda1e5aa (patch) | |
tree | cfe85f3afccda5c0f87cbb29b79e0eab8d9c0d97 /cli/ops/metrics.rs | |
parent | 04ed8d0531b7c2c308b28b742f5c332345d97065 (diff) |
Add init methods for each op module (#3087)
Diffstat (limited to 'cli/ops/metrics.rs')
-rw-r--r-- | cli/ops/metrics.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/cli/ops/metrics.rs b/cli/ops/metrics.rs deleted file mode 100644 index e1a23f6c8..000000000 --- a/cli/ops/metrics.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -use super::dispatch_json::{JsonOp, Value}; -use crate::state::ThreadSafeState; -use deno::*; -use std::sync::atomic::Ordering; - -pub fn op_metrics( - state: &ThreadSafeState, - _args: Value, - _zero_copy: Option<PinnedBuf>, -) -> Result<JsonOp, ErrBox> { - let m = &state.metrics; - - Ok(JsonOp::Sync(json!({ - "opsDispatched": m.ops_dispatched.load(Ordering::SeqCst) as u64, - "opsCompleted": m.ops_completed.load(Ordering::SeqCst) as u64, - "bytesSentControl": m.bytes_sent_control.load(Ordering::SeqCst) as u64, - "bytesSentData": m.bytes_sent_data.load(Ordering::SeqCst) as u64, - "bytesReceived": m.bytes_received.load(Ordering::SeqCst) as u64 - }))) -} |