未验证 提交 32b0d362 编写于 作者: X xzyJavaX 提交者: GitHub

Optimize the query time of tasks in ProfileTaskCache (#9780)

上级 4aa516ad
......@@ -60,6 +60,7 @@
so that the requests sent to API server is predictable (~10 requests every `interval`, 3 minutes), and the requests count is constant
regardless of the cluster's changes. However with this change SkyWalking can't react to the cluster changes in time, but the delay
is acceptable in our case.
* Optimize the query time of tasks in ProfileTaskCache.
#### UI
......
......@@ -118,16 +118,16 @@ public class ProfileTaskCache implements Service {
}
/**
* use for every db query
* use for every db query, -5 start time
*/
public long getCacheStartTimeBucket() {
return TimeBucket.getMinuteTimeBucket(System.currentTimeMillis());
return TimeBucket.getMinuteTimeBucket(System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(5));
}
/**
* use for every db query, +10 start time and +15 end time(because use task end time to search)
* use for every db query, +5 end time(because use task start time to search)
*/
public long getCacheEndTimeBucket() {
return TimeBucket.getMinuteTimeBucket(System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(25));
return TimeBucket.getMinuteTimeBucket(System.currentTimeMillis() + TimeUnit.MINUTES.toMillis(5));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册