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

chore: simplify debug logging for app readiness checks #520

Merged
merged 7 commits into from
Jan 3, 2025

Conversation

DiscreteTom
Copy link
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
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@mxfactorial
Copy link
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
Copy link
Contributor

@bnusunny bnusunny left a comment

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 awslabs:main Jan 3, 2025
23 checks passed
@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