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

feat: add metrics manager cache #1625

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add metrics cache
zealchen committed Feb 9, 2025
commit 291d7cf99b3955d6dca7b370bfb3e1142933d80b
6 changes: 2 additions & 4 deletions src/metric_engine/src/metric/mod.rs
Original file line number Diff line number Diff line change
@@ -149,10 +149,8 @@ impl MetricsInner {
// find the cache
let now_ts = Utc::now().timestamp();
let days = SegmentTimeStamp::day_diff(now_ts, timestamp);
if days < 0 // The input timestamp is more than one day ahead of the current date, is it possible?
|| days >= self.local.get_section_count() as i32
// Or, input timestamp too old, less than capacity days
{
// input timestamp is too old to stay in local cache
if days >= self.local.get_section_count() as i32 {
self._update(days, name, self.global.clone()).await
} else {
self._update(days, name, self.local.clone()).await