alibaba / sentinel-golang

Sentinel Go enables reliability and resiliency for Go microservices
https://sentinelguard.io/
Apache License 2.0
2.76k stars 431 forks source link

Upgrade the latest Metric log file name to a fixed format #552

Closed George5814 closed 8 months ago

George5814 commented 9 months ago

Describe what this PR does / why we need it

impove sentinel latest metric log file name to xxx-metrics.log.

Fix the latest file name format for convenient log collection.

Does this pull request fix one issue?

NONE

Describe how you did it

  1. replace func nextFileNameOfTime with func rotateWithDateAndNewFileName
  2. init latestOpSec before roll log file when app starting

Describe how to verify it

The implementation can be verified via go test.

Special notes for reviews

CLAassistant commented 9 months ago

CLA assistant check
All committers have signed the CLA.

codecov-commenter commented 8 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (0807185) 53.17% compared to head (232f7a5) 53.42%.

:exclamation: Current head 232f7a5 differs from pull request most recent head dd69039. Consider uploading reports for the commit dd69039 to get more accurate results

Files Patch % Lines
core/log/metric/writer.go 90.00% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## amap-customized #552 +/- ## =================================================== + Coverage 53.17% 53.42% +0.24% =================================================== Files 91 91 Lines 5894 5932 +38 =================================================== + Hits 3134 3169 +35 - Misses 2413 2417 +4 + Partials 347 346 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.