1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00
denoland-deno/cli/msg.rs

23 lines
922 B
Rust
Raw Normal View History

2019-01-21 14:03:30 -05:00
// 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;
2018-11-29 22:03:00 -05:00
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"));
2018-11-29 22:03:00 -05:00
impl<'a> From<&'a state::Metrics> for MetricsResArgs {
fn from(m: &'a state::Metrics) -> Self {
2018-11-29 22:03:00 -05:00
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,
}
}
}