Timestamp Availability Tactic - SENG-350-2024-fall/Team-1 GitHub Wiki
Source: app/backend/app.py, Lines 130-142.
def main():
# Delete existing log
with open('log.txt', 'w'):
pass
# Set up
log.basicConfig(
level=log.INFO,
format='%(asctime)s - %(levelname)s - %(message)s',
handlers=[
log.FileHandler("log.txt"),
log.StreamHandler() # This logs to the console
]
)
The Timestamp Architecture Tactic for Availability is effectively used in this code through the logging configuration in the main
function. Each log entry records a timestamp, showing the precise time of actions and events, such as successful pings or errors during the heartbeat check. By including these timestamps, administrators can track when the system was available or unavailable, providing valuable insights into downtime or performance issues. This tactic is a good choice because it enhances system transparency and troubleshooting. Timestamps allow administrators to quickly identify when problems occurred, correlate events with specific time frames, and analyze system health trends over time. In a medical triage application where availability is critical, this tactic helps maintain high reliability by enabling efficient monitoring and timely issue resolution.