2019-01-21 19:03:30 +00:00
|
|
|
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
2018-10-31 07:32:42 +00:00
|
|
|
#![allow(dead_code)]
|
2019-07-31 21:11:37 +00:00
|
|
|
#![cfg_attr(feature = "cargo-clippy", allow(clippy::all, clippy::pedantic))]
|
2019-08-24 20:20:48 +00:00
|
|
|
use crate::state;
|
2018-10-31 07:32:42 +00:00
|
|
|
use flatbuffers;
|
2019-08-24 20:20:48 +00:00
|
|
|
use std::sync::atomic::Ordering;
|
2018-11-30 03:03:00 +00:00
|
|
|
|
2018-11-01 05:06:55 +00:00
|
|
|
// 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).
|
2019-03-30 18:45:36 +00:00
|
|
|
include!(concat!(env!("GN_OUT_DIR"), "/gen/cli/msg_generated.rs"));
|
2019-08-24 20:20:48 +00:00
|
|
|
|
|
|
|
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,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|