-
Notifications
You must be signed in to change notification settings - Fork 21
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
Enhancement: Introduce Simultaneous Querying for Alarms with Deviation >= and <= in IHR API #48
Comments
To address the inefficiency in making two separate network requests for hegemony alarms with deviations >= 20 and <= -20, we can modify the code to use a single query for both deviation values concurrently. Here's the modified code:
With these changes, you can now query both deviation values concurrently, improving the efficiency of retrieving hegemony alarms. |
I think to run both const hegemonyAlarmsFilters = computed(async () => {
const hegemonyAlarmsFilter1 = new HegemonyAlarmsQuery()
.deviation(20, Query.GTE)
.timeInterval(startTime.value, endTime.value);
const hegemonyAlarmsFilter2 = new HegemonyAlarmsQuery()
.deviation(-20, Query.LTE)
.timeInterval(startTime.value, endTime.value);
const [result1, result2] = await Promise.all([
hegemonyAlarmsFilter1.run(),
hegemonyAlarmsFilter2.run()
]);
return [result1, result2];
}); |
Hello everyone, may I work on this issue ? |
Problem
Currently, our system faces a slowdown issue due to the need for two network requests to fetch hegemony alarms with a deviation >= 20 and <= -20. Given the abundance of hegemony alarms, this process becomes inefficient. The existing IHR API cannot simultaneously query both deviation values, such as >= 20 and <= -20.
Feature Description
To address the inefficiency, a new feature needs to be implemented in the IHR API. This feature should enable the querying of both deviation values concurrently, for example, >= value1 and <= -value2. This enhancement aims to significantly improve the speed of retrieving hegemony alarms.
Additional Context
To better understand the current implementation, refer to the code snippet in
ihr-website
responsible for making two separate network requests to obtain hegemony alarms with deviation >= 20 and <= -20:https://github.com/InternetHealthReport/ihr-website/blob/cae2f402dca4cb7efb74508c4bedc059a1186ae0/src/views/GlobalReport.vue#L182-L190
The text was updated successfully, but these errors were encountered: