summaryrefslogtreecommitdiff
path: root/cli/msg.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-08-24 13:20:48 -0700
committerGitHub <noreply@github.com>2019-08-24 13:20:48 -0700
commit2235dd795d3cc6c24ff1bdd1bbdcd110b4b0bdfc (patch)
treea5811adc062cbb1c66f05c863c9be245cf4fd2d2 /cli/msg.rs
parentbdc0a13261deaa3748f51d9948b4e7b92864c324 (diff)
Revert json ops (#2814)
* Revert "port more ops to JSON (#2809)" This reverts commit 137f33733d365026903d40e7cde6e34ac6c36dcf. * Revert "port ops to JSON: compiler, errors, fetch, files (#2804)" This reverts commit 79f82cf10ed1dbf91346994250d7311a4d74377a. * Revert "Port rest of os ops to JSON (#2802)" This reverts commit 5b2baa5c990fbeae747e952c5dcd7a5369e950b1.
Diffstat (limited to 'cli/msg.rs')
-rw-r--r--cli/msg.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/msg.rs b/cli/msg.rs
index db4c771f8..51726b572 100644
--- a/cli/msg.rs
+++ b/cli/msg.rs
@@ -1,8 +1,22 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
#![allow(dead_code)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::all, clippy::pedantic))]
+use crate::state;
use flatbuffers;
+use std::sync::atomic::Ordering;
// GN_OUT_DIR is set either by build.rs (for the Cargo build), or by
// build_extra/rust/run.py (for the GN+Ninja build).
include!(concat!(env!("GN_OUT_DIR"), "/gen/cli/msg_generated.rs"));
+
+impl<'a> From<&'a state::Metrics> for MetricsResArgs {
+ fn from(m: &'a state::Metrics) -> Self {
+ MetricsResArgs {
+ ops_dispatched: m.ops_dispatched.load(Ordering::SeqCst) as u64,
+ ops_completed: m.ops_completed.load(Ordering::SeqCst) as u64,
+ bytes_sent_control: m.bytes_sent_control.load(Ordering::SeqCst) as u64,
+ bytes_sent_data: m.bytes_sent_data.load(Ordering::SeqCst) as u64,
+ bytes_received: m.bytes_received.load(Ordering::SeqCst) as u64,
+ }
+ }
+}