- Changed the file paths in the Docker workflow to reflect the new directory structure for public assets.
- Removed the top referers display section from index.html to streamline the user interface and improve performance.
- Ensured proper cleanup and permissions for the new public data directory in the Docker workflow.
- Introduced a new section in the index.html to display the top referers with their respective counts.
- Implemented dynamic rendering of referers based on available data, enhancing user insights into traffic sources.
- Ensured the referers are sorted by count for better visibility and understanding of user access patterns.
- Removed custom referer parsing logic and replaced it with direct usage of r.Referer() for cleaner code.
- Updated logging to consistently use the referer from the request object across all relevant handlers.
- Enhanced readability and maintainability by eliminating redundant code related to referer extraction.
- Simplified MetricsMiddleware by removing unnecessary comments and focusing on essential request logging.
- Updated RequestLog structure to exclude the Referer field from JSON serialization, enhancing data privacy.
- Removed top referers tracking and associated HTML/CSS elements to declutter the user interface and improve performance.
- Cleaned up CSS styles related to referers for a more streamlined design.
- Added a main title to the index.html for better context.
- Introduced a new stats container to organize summary and detail statistics.
- Implemented a refresh animation for loading stats, improving user experience.
- Updated the updateStats function to streamline data handling and display.
- Enhanced the metrics section with improved formatting and error handling.
- Refined CSS styles for better visual presentation and responsiveness.
- Ensured a cleaner layout for system metrics and top referers, contributing to a more intuitive interface.
- Updated the metrics API endpoint from '/metrics' to '/api/metrics' for better organization.
- Added data validation to ensure the metrics data received is an object, enhancing error handling.
- Refactored the updateMetricsDisplay function to dynamically create metric items, improving the display of metrics.
- Implemented HTML escaping for metric keys and values to prevent XSS vulnerabilities.
- Cleared existing content in the metrics container before updating, ensuring a clean display.
- Improved LogRequest function to correctly increment counts for referers, ensuring accurate tracking of direct and indirect accesses.
- Added MarshalJSON method to SystemMetrics for proper serialization of TopReferers, facilitating better JSON representation of metrics.
- Updated comments for clarity and maintainability, enhancing code readability.
- Streamlined SystemMetrics by removing unnecessary fields and focusing on essential metrics such as AverageLatency and MemoryStats.
- Updated LogRequest to improve handling of referers and average latency calculations, ensuring accurate metrics collection.
- Enhanced the HTML display to include a dedicated section for system metrics, ensuring graceful handling of undefined values.
- Improved the presentation of top referers with a time-based reset mechanism, contributing to a cleaner and more efficient user interface.
- Removed the RecentRequests field from SystemMetrics and its associated logic in LogRequest to streamline metrics collection.
- Updated the HTML to eliminate the recent requests section, focusing on the top referers display for improved performance and clarity.
- Enhanced the overall metrics presentation by ensuring only relevant data is displayed, contributing to a cleaner user interface.
- Changed timestamp logging in the HandleAPIRequest function to use Unix milliseconds for improved precision.
- Updated the recent requests display in the HTML to correctly parse and format timestamps using the new millisecond format, enhancing readability and consistency in metrics presentation.
- Introduced global locks to protect concurrent writes to metrics maps in the LogRequest function.
- Ensured thread safety for updating status codes, path latencies, and recent requests, preventing data races.
- Improved overall reliability of metrics logging during high concurrency scenarios.
- Removed the obsolete formatLatency function from metrics.go to simplify the codebase.
- Updated the HTML to utilize the new latency formatting method, ensuring consistent display of average latency metrics.
- Enhanced the LogRequest function to accurately calculate and update average latency based on request counts, improving metrics accuracy.
- Refactored HandleAPIRequest to use a result channel for better error handling and response management.
- Updated metrics logging to directly use the full referer instead of just the main domain, enhancing data accuracy.
- Fixed recent requests display in HTML to correctly format timestamps for better readability.