-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add instance_stats background job #663
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skoeva
force-pushed
the
skoeva/bg_job
branch
2 times, most recently
from
July 31, 2023 12:59
ed51b88
to
b362a95
Compare
pothos
reviewed
Aug 1, 2023
Following #656 where we add the `instance_stats` table, we now implement a background task that populates this table every hour, with the purpose of committing a snapshot of live instance counts to the new database table. This task, using a Go ticker, is started at service startup and runs for the whole lifetime of the Nebraska server until it is stopped.
pothos
reviewed
Aug 2, 2023
pothos
approved these changes
Aug 2, 2023
skoeva
added a commit
that referenced
this pull request
Aug 7, 2023
Following #663 where we add the background job to periodically populate the instance_stats table, we want to ensure that we generate entries for instances that may not check in hourly but are still active. Thus, we consider a 2-hour default interval for instances checking in, maintaining the hourly cadence of the background job as desired.
skoeva
added a commit
that referenced
this pull request
Aug 11, 2023
author Evangelos Skopelitis <eas458@cornell.edu> 1690946509 -0400 committer Evangelos Skopelitis <eas458@cornell.edu> 1691771003 -0400 parent b641c2b author Evangelos Skopelitis <eas458@cornell.edu> 1690946509 -0400 committer Evangelos Skopelitis <eas458@cornell.edu> 1691770975 -0400 Defined endpoints, registered handler, added func Commented out JSON metrics endpoint spec backend: Use UTC for instance stats default time The time.Now() function uses the local time which causes a mismatch and no entries get created when, e.g., being two hours ahead because the instance would be checking in at 10 UTC but it gets compared to 12 local time and in this time span nothing is able to check in because the local time will always be too far ahead. Use the right time zone for the default time of the instance stats query. Added gauge metric and testing Updated handler Added custom registry and handler Cosmetic changes Adding JSON endpoint Debugging Removing unnecessary test parent b641c2b author Evangelos Skopelitis <eas458@cornell.edu> 1690946509 -0400 committer Evangelos Skopelitis <eas458@cornell.edu> 1691764647 -0400 Defined endpoints, registered handler, added func Commented out JSON metrics endpoint spec Added gauge metric and testing Added custom registry and handler Cosmetic changes Adding JSON endpoint Debugging Removing unnecessary test backend: Use UTC for instance stats default time The time.Now() function uses the local time which causes a mismatch and no entries get created when, e.g., being two hours ahead because the instance would be checking in at 10 UTC but it gets compared to 12 local time and in this time span nothing is able to check in because the local time will always be too far ahead. Use the right time zone for the default time of the instance stats query. Added gauge metric and testing Cosmetic changes Adding JSON endpoint Debugging Removing unnecessary test backend: Change default interval for instance stats query Following #663 where we add the background job to periodically populate the instance_stats table, we want to ensure that we generate entries for instances that may not check in hourly but are still active. Thus, we consider a 2-hour default interval for instances checking in, maintaining the hourly cadence of the background job as desired. Removing another unnecessary test
skoeva
added a commit
that referenced
this pull request
Aug 11, 2023
Commented out JSON metrics endpoint spec backend: Use UTC for instance stats default time The time.Now() function uses the local time which causes a mismatch and no entries get created when, e.g., being two hours ahead because the instance would be checking in at 10 UTC but it gets compared to 12 local time and in this time span nothing is able to check in because the local time will always be too far ahead. Use the right time zone for the default time of the instance stats query. Added gauge metric and testing Updated handler Added custom registry and handler Cosmetic changes Adding JSON endpoint Debugging Removing unnecessary test backend: Change default interval for instance stats query Following #663 where we add the background job to periodically populate the instance_stats table, we want to ensure that we generate entries for instances that may not check in hourly but are still active. Thus, we consider a 2-hour default interval for instances checking in, maintaining the hourly cadence of the background job as desired. Removing another unnecessary test
skoeva
added a commit
that referenced
this pull request
Aug 11, 2023
Commented out JSON metrics endpoint spec backend: Use UTC for instance stats default time The time.Now() function uses the local time which causes a mismatch and no entries get created when, e.g., being two hours ahead because the instance would be checking in at 10 UTC but it gets compared to 12 local time and in this time span nothing is able to check in because the local time will always be too far ahead. Use the right time zone for the default time of the instance stats query. Added gauge metric and testing Updated handler Added custom registry and handler Cosmetic changes Adding JSON endpoint Debugging Removing unnecessary test backend: Change default interval for instance stats query Following #663 where we add the background job to periodically populate the instance_stats table, we want to ensure that we generate entries for instances that may not check in hourly but are still active. Thus, we consider a 2-hour default interval for instances checking in, maintaining the hourly cadence of the background job as desired. Removing another unnecessary test
skoeva
added a commit
that referenced
this pull request
Aug 11, 2023
Commented out JSON metrics endpoint spec backend: Use UTC for instance stats default time The time.Now() function uses the local time which causes a mismatch and no entries get created when, e.g., being two hours ahead because the instance would be checking in at 10 UTC but it gets compared to 12 local time and in this time span nothing is able to check in because the local time will always be too far ahead. Use the right time zone for the default time of the instance stats query. Added gauge metric and testing Updated handler Added custom registry and handler Cosmetic changes Adding JSON endpoint Debugging Removing unnecessary test backend: Change default interval for instance stats query Following #663 where we add the background job to periodically populate the instance_stats table, we want to ensure that we generate entries for instances that may not check in hourly but are still active. Thus, we consider a 2-hour default interval for instances checking in, maintaining the hourly cadence of the background job as desired. Removing another unnecessary test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following #656 where we add the
instance_stats
table, we now implement a background task that populates this table every hour, with the purpose of committing a snapshot of live instance counts to the new database table. This task, using a Go ticker, is started at service startup and runs for the whole lifetime of the Nebraska server until it is stopped.