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

fix: card stats calculations in workflow executions #1835

Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
92c51fb
feat:added side nav bar and filter tabs for table
rajesh-jonnalagadda Aug 27, 2024
3c42275
feat: added stats cards, graph and pagination frontend logic
rajesh-jonnalagadda Aug 29, 2024
f39c501
feat:added backend pagination capability to the workflow executions a…
rajesh-jonnalagadda Aug 29, 2024
2b0e5ea
feat: add run and yaml defintion modals and code cleanup
rajesh-jonnalagadda Aug 30, 2024
bd17870
refactor: add original links in side nav bar
rajesh-jonnalagadda Aug 30, 2024
a6114f7
chore: revert the shoAll for workfflow card
rajesh-jonnalagadda Aug 30, 2024
d24861a
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
rajesh-jonnalagadda Aug 31, 2024
4ef2304
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
rajesh-jonnalagadda Sep 2, 2024
9384cc8
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
rajesh-jonnalagadda Sep 2, 2024
d326f39
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
talboren Sep 3, 2024
61828e4
feat: add table filters status, trigger and exection id
rajesh-jonnalagadda Sep 3, 2024
c2ed9a4
Merge branch 'feat-1727-new-workflow-execution-page-local-main' of gi…
rajesh-jonnalagadda Sep 3, 2024
b627f7f
fix: lint issues
rajesh-jonnalagadda Sep 3, 2024
7a3cf4f
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
rajesh-jonnalagadda Sep 3, 2024
6489eab
refactor: convert the started at and exection time into given ui format
rajesh-jonnalagadda Sep 3, 2024
d9369eb
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
rajesh-jonnalagadda Sep 4, 2024
59c5029
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
talboren Sep 4, 2024
6fdd84c
refactor:minor style changes on table, pagiantion and filters
rajesh-jonnalagadda Sep 4, 2024
b3ff800
Merge branch 'feat-1727-new-workflow-execution-page-local-main' of gi…
rajesh-jonnalagadda Sep 4, 2024
23706fc
fix: table border issue
rajesh-jonnalagadda Sep 4, 2024
0e4c4b9
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
rajesh-jonnalagadda Sep 4, 2024
6fcf453
changed the pagiantion values
rajesh-jonnalagadda Sep 4, 2024
a3280d6
feat: handle trigger filters and modify the options in the popover co…
rajesh-jonnalagadda Sep 4, 2024
89b4851
refactor: add additonal check for status and trigger
rajesh-jonnalagadda Sep 4, 2024
da85d39
Merge branch 'feat-1727-new-workflow-execution-page-local-main' of gi…
rajesh-jonnalagadda Sep 4, 2024
440cd6c
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
rajesh-jonnalagadda Sep 4, 2024
8df8076
fix: side nav-bar overflow isseu and workflow card onclick redirection
rajesh-jonnalagadda Sep 5, 2024
95c190f
Merge branch 'feat-1727-new-workflow-execution-page-local-main' of gi…
rajesh-jonnalagadda Sep 5, 2024
df9a0bf
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
talboren Sep 5, 2024
5b47d92
refactor: add row clickable redirection and removed logs
rajesh-jonnalagadda Sep 5, 2024
b542d02
Merge branch 'feat-1727-new-workflow-execution-page-local-main' of gi…
rajesh-jonnalagadda Sep 5, 2024
7e13da2
fix: stats calculations
rajesh-jonnalagadda Sep 5, 2024
a31d884
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
rajesh-jonnalagadda Sep 5, 2024
77000c8
Merge branch 'main' into feat-1727-new-workflow-execution-page-local-…
rajesh-jonnalagadda Sep 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions keep/api/core/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,17 +619,18 @@ def get_workflow_executions(tenant_id, workflow_id, limit=50, offset=0, tab=2, s


total_count = query.count()
status_counts = session.query(
status_counts = query.with_entities(
WorkflowExecution.status,
func.count().label('count')
).group_by(WorkflowExecution.status).all()

statusGroupbyMap = {status: count for status, count in status_counts}

passCount = statusGroupbyMap.get('success', 0)
failCount = statusGroupbyMap.get('error', 0) + statusGroupbyMap.get('timeout', 0)
passFail = (passCount / failCount) * 100 if failCount > 0 else 100.00

if passCount > 0:
passFail = (passCount / failCount) * 100 if failCount > 0 else 100.00
else:
passFail = 0.0
avgDuration = query.with_entities(func.avg(WorkflowExecution.execution_time)).scalar()
avgDuration = avgDuration if avgDuration else 0.0

Expand Down
Loading