Insights

Struct Insights 

Source
pub struct Insights { /* private fields */ }

Implementations§

Source§

impl Insights

Source

pub fn new(options: &TopicOptions, tether_agent: &mut TetherAgent) -> Self

Examples found in repository?
examples/api.rs (line 62)
51fn demo_topics() {
52    let mut tether_agent = TetherAgentOptionsBuilder::new("demoTopics")
53        .build()
54        .expect("failed to init/connect Tether Agent");
55
56    let options = TopicOptions {
57        topic: "#".into(),
58        sampler_interval: 1000,
59        graph_enable: false,
60    };
61
62    let mut insights = Insights::new(&options, &mut tether_agent);
63
64    loop {
65        while let Some((topic, payload)) = tether_agent.check_messages() {
66            if insights.update(&topic, payload) {
67                println!("TOPICS: Insights update: \n{}", insights);
68            }
69        }
70    }
71}
Source

pub fn sample(&mut self) -> bool

Source

pub fn sampler(&self) -> &Sampler

Source

pub fn update(&mut self, topic: &TetherOrCustomTopic, payload: Vec<u8>) -> bool

Examples found in repository?
examples/api.rs (line 66)
51fn demo_topics() {
52    let mut tether_agent = TetherAgentOptionsBuilder::new("demoTopics")
53        .build()
54        .expect("failed to init/connect Tether Agent");
55
56    let options = TopicOptions {
57        topic: "#".into(),
58        sampler_interval: 1000,
59        graph_enable: false,
60    };
61
62    let mut insights = Insights::new(&options, &mut tether_agent);
63
64    loop {
65        while let Some((topic, payload)) = tether_agent.check_messages() {
66            if insights.update(&topic, payload) {
67                println!("TOPICS: Insights update: \n{}", insights);
68            }
69        }
70    }
71}
Source

pub fn topics(&self) -> &[String]

Source

pub fn roles(&self) -> &[String]

Source

pub fn ids(&self) -> &[String]

Source

pub fn plugs(&self) -> &[String]

Source

pub fn trees(&self) -> &[AgentTree]

Source

pub fn message_count(&self) -> u128

Source

pub fn message_log( &self, ) -> &CircularBuffer<MONITOR_LOG_LENGTH, (String, String)>

Source

pub fn since_log_start(&self) -> Option<Duration>

Source

pub fn get_rate(&self) -> Option<f32>

Messages per second, since log_start was (re)set

Trait Implementations§

Source§

impl Display for Insights

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,