8000 Results recap display · Issue #583 · ansible-community/ara · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Results recap display #583

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

Open
garyverhulp opened this issue Jan 23, 2025 · 2 comments
Open

Results recap display #583

garyverhulp opened this issue Jan 23, 2025 · 2 comments

Comments

@garyverhulp
Copy link

What is the idea ?

Simple feature request.
For the main playbooks page, I would like to see a breakdown of the results recap. OK, changed, unreachable, failed, skipped , rescued ignored

I'm not sure how to fit all this info on the main page. It might end up cluttered.

Thank you.

@NiceRath
Copy link
NiceRath commented Jan 23, 2025

This can be related to the idea in #584 of hiding additional information behind a button or hoverable-field.

BTW: There already is a status-recap inside the 'hosts' view - the complete playbook recap could look similar to that one.

@dmsimard
Copy link
Contributor

Hi and thanks for the issue @garyverhulp.

This would be nice to have.

Like NiceRath mentions we have these numbers for hosts:

Image

I understand that we do not have them for playbooks and there is a reason, though we could revisit.

The reason we have these numbers for hosts is that ansible-core gives it for each individual host at the end of a playbook.
ara picks that up and puts it into the database:

def _load_stats(self, stats):
hosts = sorted(stats.processed.keys())
for hostname in hosts:
host = self._get_or_create_host(hostname)
host_stats = stats.summarize(hostname)
self._submit_thread(
"global",
self.client.patch,
"/api/v1/hosts/%s" % host["id"],
changed=host_stats["changed"],
unreachable=host_stats["unreachable"],
failed=host_stats["failures"],
ok=host_stats["ok"],
skipped=host_stats["skipped"],
)

We do not have it "globally" (an aggregation of hosts' stats) because ansible doesn't provide it and we do not calculate it.
There's different ways we could calculate it, thinking out loud:

  1. increment counters from within the callback (after async threads have returned) and record it to the playbook at the end with an extra PATCH
  2. do it within the database model, i.e increment the counter whenever a host's result is updated
  3. do it within the API, ex: when doing a GET on a playbook, compute aggregate status for each host to get numbers and return them within the call (expensive and wasteful)

I think the most efficient way is doing option 1 within the callback.
We can create a "stats" field in the playbook model and API, make the callback gather the aggregate stats and update the field. Once the data is there, we need to update the UI with something similar to the hosts page.

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

No branches or pull requests

3 participants
0