Skip to content

Commit 337628a

Browse files
committed
Debug route to list all containers we think are running
1 parent 7a255cb commit 337628a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

ui/src/server_axum.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ use axum_extra::{
2626
TypedHeader,
2727
};
2828
use futures::{future::BoxFuture, FutureExt};
29-
use orchestrator::coordinator::{self, CoordinatorFactory, DockerBackend, Versions};
29+
use orchestrator::coordinator::{
30+
self, CoordinatorFactory, DockerBackend, Versions, TRACKED_CONTAINERS,
31+
};
3032
use snafu::prelude::*;
3133
use std::{
3234
convert::TryInto,
@@ -101,6 +103,10 @@ pub(crate) async fn serve(config: Config) {
101103
.route("/websocket", get(websocket))
102104
.route("/nowebsocket", post(nowebsocket))
103105
.route("/internal/debug/whynowebsocket", get(whynowebsocket))
106+
.route(
107+
"/internal/debug/tracked-containers",
108+
get(tracked_containers),
109+
)
104110
.layer(Extension(factory))
105111
.layer(Extension(db_handle))
106112
.layer(Extension(Arc::new(SandboxCache::default())))
@@ -680,6 +686,16 @@ async fn whynowebsocket() -> String {
680686
format!("{:#?}", WS_ERRORS.lock().unwrap_or_else(|e| e.into_inner()))
681687
}
682688

689+
async fn tracked_containers() -> String {
690+
let tracked_containers = TRACKED_CONTAINERS
691+
.lock()
692+
.unwrap_or_else(|e| e.into_inner())
693+
.clone();
694+
tracked_containers
695+
.iter()
696+
.fold(String::new(), |a, s| a + s + "\n")
697+
}
698+
683699
#[derive(Debug)]
684700
struct MetricsAuthorization;
685701

0 commit comments

Comments
 (0)