Skip to content

chore: simplify debug logging for app readiness checks#520

Merged
bnusunny merged 7 commits into
aws:mainfrom
DiscreteTom:improve-logging
Jan 3, 2025
Merged

chore: simplify debug logging for app readiness checks#520
bnusunny merged 7 commits into
aws:mainfrom
DiscreteTom:improve-logging

Conversation

@DiscreteTom

Copy link
Copy Markdown
Contributor

Description of changes:
Simplify debug logging for app readiness checks to prevent abusing the logs. Move the original "app is not ready" to the trace log level.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@DiscreteTom DiscreteTom requested a review from a team as a code owner October 9, 2024 07:38
Comment thread src/lib.rs Outdated
Comment thread src/lib.rs Outdated
@mxfactorial

Copy link
Copy Markdown
Contributor

easier to test

struct Checkpoint {
    start: Instant,
    interval: i32,
    next: i32,
};

impl Checkpoint {
    fn new() -> Checkpoint {
        let interval: i32 = 2;
        let start = Instant::now();
        Checkpoint {
            start,
            interval,
            next: start.elapsed().as_secs() as i32 + interval,
        }
    }

    fn increment(&mut self) {
        self.next += self.interval;
    }

    fn lapsed(&self) -> bool {
        if self.start.elapsed().as_secs() as i32 >= self.next {
            true
        } else {
            false
        }
    }
}

@DiscreteTom DiscreteTom requested a review from bnusunny January 2, 2025 06:52
Comment thread src/readiness.rs

@bnusunny bnusunny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bnusunny bnusunny merged commit 1e8c2cc into aws:main Jan 3, 2025
@DiscreteTom DiscreteTom deleted the improve-logging branch January 3, 2025 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants