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

Add miq_har_file_parser #10

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Add miq_har_file_parser #10

wants to merge 15 commits into from

Conversation

NickLaMuro
Copy link
Owner

A lib for generating rails runner scripts to run a sequence of requests for benchmarking the MIQ UI ruby backend requests.

A lib for generating `rails runner` scripts to run a sequence of
requests for benchmarking the MIQ UI ruby backend requests.
In older versions of MIQ, `UiConstants` was a global constant is
required to be autoloaded for many of the controller actions to work.

Unfortunately, this was not done by default for the `rails runner` in
the older versions of MIQ where this existed, so this adds an option to
load it via the `miq_har_file_parser/cli`.
The help docs for the CLI allow for either passing a file.har as a final
argument, or as a command line argument via the `--input` flag.

Do to the way it was coded, it always forced using the result of the
`HAR_FILE` ARGV instead of the parsed option.  This change allows the
arguments to work as expected.
Seems like Firefox supports multiple values for defining params:

- One for handling the url params
- And one for handling body params

This fix attempts to munge the second one into the format of the first.
NOTE:  MANY HOURS WASTED FIGURING THIS OUT!!1!

Turns out that the rails session will automatically log you out if you
are not in the same mode "http mode" (`http` or `https`), and this is
not super obvious when using the integration test framework to run
commands that this is happening (basically, stuff just starts
redirecting to login on you, with no logging at all).

Since all appliances are configured out of the box to use `https` in
puma, this seemed like a safe default in the script to just enable
`.https!` if we are on an appliance by just querying it.  Might make it
configurable in the future, but no promises.
Turns out that Chrome and Firefox sort the "entries" differently.  The
Firefox (sanely) is in chronological order, but the Chrome one (for
whatever reason...) is not.

Sorting by `startedDateTime` ensures that we are get the results in the
order we requested them, allowing the generated script to function as
expected.

The `startedDateTime` is also added to the parsed requests hash, and
displayed in the summary printout.
Another difference between Firefox and Chrome is that chrome uses
decimal precision when displaying time (in milliseconds).  This
precision is not needed for our purposes, so a `.to_i` is called on the
value to make it a consistent view between the two
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.

1 participant