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

Imagine if we could run 1000's of queries nightly in Quepid!!! #976

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

epugh
Copy link
Member

@epugh epugh commented Mar 8, 2024

Description

This takes the existing Angular1 app and makes a small stripped version that just runs the query and the splainer stuff, and dumps out a text field in the "Snapshot" JSON format. Then, this is exposed by the api /api/agent_q/fetch as the JSON response. Oh, how does the API get the data? Glad you asked friend! The API instantiates Chrome and uses Chrome to invoke the stripped down case! It's like that movie Inception ;-).

sequenceDiagram
    Alice->>+QuepidAPI: I want to run a query for case 5 and get back the docs.  /api/cases/5/agent_q/
    QuepidAPI->>+AgentQ: Can you run a query for me.
    AgentQ->>+Chrome: Can you run a query for me.
    Chrome-->>-QuepidAPI: Please run for me /core/5/stripped
    QuepidAPI-->>-Chrome: Here is the HTML page with the data you want.
    Chrome->>AgentQ: Here is the rendered HTML page
    AgentQ-->>QuepidAPI: Here is the json response you want
    QuepidAPI-->>Alice: Here is the query doc data in JSON

Motivation and Context

We have lots of logic in JavaScript and to move it out of there appears to be sissyphean... Leading us down the "big rewrite" path. Let's encapsulate the Angular1 and not expose it to more things.

Let's make it possible to run lots of queries... So if you have 5000 queries, let's run them in batches of 50, and we invoke the browser 100 times. Or batches of 10 and invoke it 500 times!

How Has This Been Tested?

Screenshots or GIFs (if appropriate):

Types of changes

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] Improvement (non-breaking change which improves existing functionality)
  • [] New feature (non-breaking change which adds new functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [] My code follows the code style of this project.
  • [] My change requires a change to the documentation.
  • [] I have updated the documentation accordingly.
  • [] I have read the CONTRIBUTING document.
  • [] I have added tests to cover my changes.
  • [] All new and existing tests passed.

@epugh epugh temporarily deployed to quepid-pr-976 April 17, 2024 21:33 Inactive
@epugh
Copy link
Member Author

epugh commented Apr 18, 2024

corsego/161-gem-ferrum@34cd066 for an example!

@epugh
Copy link
Member Author

epugh commented Apr 19, 2024

Reminder: check the procfile for the need for the -q param!

@epugh
Copy link
Member Author

epugh commented Apr 22, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant