Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for laminar metrics. #153

Open
3 tasks
TimonPost opened this issue Mar 10, 2019 · 3 comments
Open
3 tasks

Implement support for laminar metrics. #153

TimonPost opened this issue Mar 10, 2019 · 3 comments
Labels
difficulty: medium enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@TimonPost
Copy link
Owner

TimonPost commented Mar 10, 2019

Task Description

Laminar currently does not provide much internal information to the outside. To solve this we need to have metrics, and a way to integrate this easily.

Task TODO

  • Think of metrics we can collect
  • Are there crates that can help us with this
  • Think of design to move metrics into our current API without too many changes.
@TimonPost TimonPost added the good first issue Good for newcomers label Mar 10, 2019
@TimonPost TimonPost changed the title Implement metrics. Implement sport for laminar metrics. Jul 6, 2019
@TimonPost TimonPost added difficulty: medium enhancement New feature or request help wanted Extra attention is needed labels Jul 6, 2019
@TimonPost
Copy link
Owner Author

TimonPost commented Jul 6, 2019

My idea to implement this is the following:

  1. We can make SocketEvent have an entry for Metrics:
pub enum SocketEvent {
    /// A packet has been received from a client.
    Packet(Packet),
    /// A new client connects. Clients are uniquely identified by the ip:port combination at this layer.
    Connect(SocketAddr),
    /// A client disconnects. This is generated from the server-side intentionally disconnecting a client,
    /// or it could be from the client disconnecting.
    Disconnect(SocketAddr),
    /// This is generated if the server has not seen traffic from a client after a configurable amount of time.
    Timeout(SocketAddr),
    
    /// Metrics of lamianar
    Metrics(Metrics)
}
  1. Example of metrics we can gather:
    source
pub struct Metrics {
    counters: [u64; DataPoint::Length as usize],
    packet_loss: f32,
    sent_bandwidth_kbps: f32,
    received_bandwidth_kbps: f32,
    acked_bandwidth_kbps: f32,

    // Config values to tweak the calculated fields
    bandwidth_smoothing_factor: f32,
}
  1. Send metrics back to the user
    Because we created a Metrics entry for the SocketEvent we can send it on the EventChannel

  2. Add a config entry

  • Metrics Enabled; whether we should calculate metrics or not.
  • Metrics send interval; send on event channel.

@TimonPost TimonPost changed the title Implement sport for laminar metrics. Implement support for laminar metrics. Jul 6, 2019
@ncallaway
Copy link
Contributor

It seems like this could potentially be combined with:

I might try and roll all of those into a single interface and PR.

Should metrics be on an event, or on an on-demand poll?

@TimonPost
Copy link
Owner Author

Thats a good question. I tended to see them as an event like my comment above shows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants