Skip to content

Commit

Permalink
chore: Add tracing for debuging the js procedure slowness (#1552)
Browse files Browse the repository at this point in the history
* chore: Add tracing for debuging the js procedure slowness

* chore: Make the display to reduce vertical clutter
  • Loading branch information
Blu-J authored Jun 20, 2022
1 parent 09c0448 commit 1f5e6db
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions backend/src/procedure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ impl PackageProcedure {
allow_inject: bool,
timeout: Option<Duration>,
) -> Result<Result<O, (i32, String)>, Error> {
tracing::trace!("Procedure execute {} {} - {:?}", self, pkg_id, name);
match self {
PackageProcedure::Docker(procedure) => {
procedure
Expand Down Expand Up @@ -106,6 +107,7 @@ impl PackageProcedure {
timeout: Option<Duration>,
name: ProcedureName,
) -> Result<Result<O, (i32, String)>, Error> {
tracing::trace!("Procedure sandboxed {} {} - {:?}", self, pkg_id, name);
match self {
PackageProcedure::Docker(procedure) => {
procedure
Expand All @@ -122,6 +124,15 @@ impl PackageProcedure {
}
}

impl std::fmt::Display for PackageProcedure {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
PackageProcedure::Docker(_) => write!(f, "Docker")?,
PackageProcedure::Script(_) => write!(f, "JS")?,
}
Ok(())
}
}
#[derive(Debug)]
pub struct NoOutput;
impl<'de> Deserialize<'de> for NoOutput {
Expand Down

0 comments on commit 1f5e6db

Please sign in to comment.