diff --git a/src/client.rs b/src/client.rs index 4fd579ab..e1fa94c7 100644 --- a/src/client.rs +++ b/src/client.rs @@ -62,7 +62,7 @@ where /// the various state behind the server. This provides transitive access to /// various configuration options of the server as well as the ability to /// call back into Python. - pub fn new(ws: T, srv: &Rc, mut uarx: Receiver, host: String) -> Client { + pub fn new(ws: T, srv: &Rc, mut uarx: Receiver) -> Client { let srv = srv.clone(); let timeout = Timeout::new(srv.opts.open_handshake_timeout.unwrap(), &srv.handle).unwrap(); let (tx, rx) = mpsc::unbounded(); @@ -86,7 +86,6 @@ where srv: srv.clone(), ws, user_agent: uastr, - host, broadcast_subs: broadcast_subs.clone(), }, timeout, @@ -134,7 +133,6 @@ struct SessionStatistics { uaid_reset: bool, existing_uaid: bool, connection_type: String, - host: String, // Usage data direct_acked: i32, @@ -217,7 +215,6 @@ pub struct UnAuthClientData { srv: Rc, ws: T, user_agent: String, - host: String, broadcast_subs: Rc>, } @@ -394,7 +391,6 @@ where srv, ws, user_agent, - host, broadcast_subs, } = data; @@ -419,7 +415,6 @@ where uaid_reset: reset_uaid, existing_uaid: check_storage, connection_type: String::from("webpush"), - host: host.clone(), ..Default::default() }, ..Default::default() @@ -487,10 +482,9 @@ where let (ua_result, metrics_os, metrics_browser) = parse_user_agent(&parser, &user_agent); // dogstatsd doesn't support timers: use histogram instead srv.metrics - .histogram_with_tags("ua.connection.lifespan", elapsed) + .time_with_tags("ua.connection.lifespan", elapsed) .with_tag("ua_os_family", metrics_os) .with_tag("ua_browser_family", metrics_browser) - .with_tag("host", &webpush.stats.host) .send(); // If there's direct unack'd messages, they need to be saved out without blocking @@ -524,7 +518,6 @@ where "uaid_reset" => stats.uaid_reset, "existing_uaid" => stats.existing_uaid, "connection_type" => &stats.connection_type, - "host" => &stats.host, "ua_name" => ua_result.name, "ua_os_family" => metrics_os, "ua_os_ver" => ua_result.os_version, diff --git a/src/server/mod.rs b/src/server/mod.rs index db82a498..6fec9ed5 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -349,8 +349,6 @@ impl Server { let srv2 = srv.clone(); let handle2 = handle.clone(); - let host = format!("{}", addr.ip()); - // Setup oneshot to extract the user-agent from the header callback let (uatx, uarx) = oneshot::channel(); let callback = |req: &Request| { @@ -386,7 +384,7 @@ impl Server { // the internal state machine. Box::new( ws.and_then(move |ws| { - PingManager::new(&srv2, ws, uarx, host) + PingManager::new(&srv2, ws, uarx) .chain_err(|| "failed to make ping handler") }).flatten(), ) @@ -654,7 +652,6 @@ impl PingManager { srv: &Rc, socket: WebSocketStream, uarx: oneshot::Receiver, - host: String, ) -> io::Result { // The `socket` is itself a sink and a stream, and we've also got a sink // (`tx`) and a stream (`rx`) to send messages. Half of our job will be @@ -675,7 +672,7 @@ impl PingManager { timeout: Timeout::new(srv.opts.auto_ping_interval, &srv.handle)?, waiting: WaitingFor::SendPing, socket: socket.clone(), - client: CloseState::Exchange(Client::new(socket, srv, uarx, host)), + client: CloseState::Exchange(Client::new(socket, srv, uarx)), srv: srv.clone(), }) }