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

Record and emit the timestamp that the last connection was establishe… #4035

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

tshan2001
Copy link
Contributor

Summary

This PR is to add a new field in the Session struct to record the timestamp of the latest connection to ACS. Also added a method in the struct's interface to retrieve this value.

Implementation details

The newly added field lastConnectedTime is initialized with value time.Time{}, which is the default zero value for time.Time. It will be updated to the current time in startSessionOnce() to reflect the latest time that a connection to ACS was established.

Testing

bot/test label has been added to the PR for functional tests.

New tests cover the changes:
A new test called TestGetLastConnectedTime() has been added to /amazon-ecs-agent/ecs-agent/acs/session/session_test.go to test the behavior of the newly added field and interface in the struct.

Description for the changelog

Record and emit the timestamp that a connection was established to ACS

Does this PR include breaking model changes? If so, Have you added transformation functions?

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tshan2001 tshan2001 requested a review from a team as a code owner November 16, 2023 21:23
@danehlim danehlim merged commit 69faa80 into aws:dev Nov 16, 2023
38 checks passed
@danehlim danehlim mentioned this pull request Dec 4, 2023
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.

4 participants