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

feat: remove the unused metrics module #698

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions autoconnect/autoconnect-web/src/dockerflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,18 @@ pub fn config(config: &mut web::ServiceConfig) {
}

/// Handle the `/health` and `/__heartbeat__` routes
// note, this changes to `blocks_in_conditions` for 1.76+
#[allow(clippy::blocks_in_conditions)]
pub async fn health_route(state: Data<AppState>) -> Json<serde_json::Value> {
let status = if state
let healthy = state
.db
.health_check()
.await
.map_err(|e| {
error!("Autoconnect Health Error: {:?}", e);
e
})
.is_ok()
{
"OK"
} else {
"ERROR"
};
//TODO: query local state and report results
.is_ok();
Json(json!({
"status": status,
"status": if healthy { "OK" } else { "ERROR" },
"version": env!("CARGO_PKG_VERSION"),
}))
}
Expand Down
1 change: 0 additions & 1 deletion autoconnect/autoconnect-web/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ extern crate slog_scope;

pub mod dockerflow;
pub mod error;
pub mod metrics;
pub mod routes;
#[cfg(test)]
mod test;
Expand Down
182 changes: 0 additions & 182 deletions autoconnect/autoconnect-web/src/metrics.rs

This file was deleted.

3 changes: 0 additions & 3 deletions autoconnect/autoconnect-ws/autoconnect-ws-sm/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ where
impl SMError {
pub fn close_code(&self) -> actix_ws::CloseCode {
match self.kind {
// TODO: applicable here?
//SMErrorKind::InvalidMessage(_) => CloseCode::Invalid,
SMErrorKind::UaidReset => CloseCode::Normal,
_ => CloseCode::Error,
}
Expand Down Expand Up @@ -70,7 +68,6 @@ impl ReportableError for SMError {
}

fn metric_label(&self) -> Option<&'static str> {
// TODO:
match &self.kind {
SMErrorKind::Database(e) => e.metric_label(),
SMErrorKind::MakeEndpoint(e) => e.metric_label(),
Expand Down
3 changes: 1 addition & 2 deletions autoconnect/autoconnect-ws/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ impl WSError {
pub fn close_code(&self) -> actix_ws::CloseCode {
match &self.kind {
WSErrorKind::SM(e) => e.close_code(),
// TODO: applicable here?
//WSErrorKind::Protocol(_) => CloseCode::Protocol,
WSErrorKind::Protocol(_) => CloseCode::Protocol,
WSErrorKind::UnsupportedMessage(_) => CloseCode::Unsupported,
_ => CloseCode::Error,
}
Expand Down