-
Notifications
You must be signed in to change notification settings - Fork 14
Fix for high network utilization from operation api endpoint #51
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
Comments
Im wondering if we are passing the wrong type for the time variable to the setInterval(). Did you notice any improvement when just passing the int 3000 instead of str "3000"? |
I did some checking on that - setInterval should accept a string and contort it into an int. I didn't see any changes with our without the quotes unfortunately. While I was trolling through the source code I did see a note about doing some sorting on the operations returned right after the call to the /api/v2/operations endpoint that was killing my bandwidth. Here maybe? It makes me think that what is really needed for a proper long term solution (instead of slowing down the console refresh rate would be a new endpoint, maybe If I'm understanding the flow correctly, this is what is occurring. Magma
Caldera
Comments This makes me think that the fix for this is still in Magma, since that's where the call to this endpoint is occurring. The find_and_dump_objects function looks like (again, I'm a PowerShell guy moreso then Python) it should have support for search criteria, and The include / exclude statements make it looks like the HTTP request should have include / exclude filters defined. I have no idea what this should look like or I'd try running it against my /api/v2/operations endpoint to see. For what it's worth, calling the If you could provide what that filter syntax should look like @elegantmoose I'd love to try it. Once that filtering narrowed down to live actions, I'm thinking that adding the filtering into |
I can't believe I didn't notice the swagger docs here. Looks like something like this in the Magma would do it, maybe? I'm sure my syntax is off, not much of a JavaScript guy either. operationStore.js
|
I dug into this a bit further.. That getOperations is used a ton of other places so that changing that behavior doesn't seem a viable method. I'm playing with an alternative function that does the same thing getOperationsMetadata that could be called instead of Maybe something like this? |
I recently opened a ticket for caldera, 2980 that is more closely related here.
For reference, this is for a 5.0.0 Caldera instance running with the latest build for Magma.
After disabling the minification for vite I was able to track down the cause.
The calls to the API endpoint api/v2/operations were definitely coming from operationStore.js (I added a
console.error
each time it was called to be sure it was the same path.vite.config.js
operationStore.js
From here I located the calls to getOperations in
OperationsView.vue
.The function name selectOperation lines up with non minified code.
I'm not for sure what that code is supposed to be doing, but on the current release there is something wrong the this logic.
OperationsView.vue
My best guess is for some reason the time is getting set to zero from the setInterval call, and the updates are running constantly.
When I made the updateInterval 30 seconds and entered it as an int vs a string it worked as I think is intended, without DOSing my host.
I'm not sure how many people have hundreds of operations with hundreds of line items each, but that api/v2/operations gets large in a hurry for me.. Having this be a configurable option - and having a higher default in my opinion - would be worth consideration.
OperationsView.vue
The text was updated successfully, but these errors were encountered: