2018-10-31 03:32:42 -04:00
|
|
|
#![allow(unused_imports)]
|
|
|
|
#![allow(dead_code)]
|
2018-11-05 01:21:21 -05:00
|
|
|
#![cfg_attr(feature = "cargo-clippy", allow(clippy, pedantic))]
|
2018-10-31 03:32:42 -04:00
|
|
|
use flatbuffers;
|
2018-11-29 22:03:00 -05:00
|
|
|
use std::sync::atomic::Ordering;
|
|
|
|
|
2018-11-01 01:06:55 -04: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).
|
|
|
|
include!(concat!(env!("GN_OUT_DIR"), "/gen/msg_generated.rs"));
|
2018-11-29 22:03:00 -05:00
|
|
|
|
|
|
|
impl<'a> From<&'a super::isolate::Metrics> for MetricsResArgs {
|
|
|
|
fn from(m: &'a super::isolate::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,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|