+
{Math.round(playbook.duration)} sec
diff --git a/src/tasks/TaskRow.js b/src/tasks/TaskRow.js
index 3bc9d10..44d161b 100644
--- a/src/tasks/TaskRow.js
+++ b/src/tasks/TaskRow.js
@@ -78,9 +78,9 @@ export default class TaskRow extends Component {
className={`pf-c-table__expandable-row ${isExpanded &&
"pf-m-expanded"}`}
>
-
+ |
Task results
+ Status |
Host |
Started |
Ended |
Duration |
- Status |
{task.results.map(result => (
+
+ {result.status}
+ |
{result.host.name}
|
@@ -118,19 +124,12 @@ export default class TaskRow extends Component {
>
{result.duration}
-
- {result.status}
- |
))}
|
- |
);
diff --git a/src/tasks/Tasks.js b/src/tasks/Tasks.js
index b2dad1e..e6b3277 100644
--- a/src/tasks/Tasks.js
+++ b/src/tasks/Tasks.js
@@ -6,7 +6,7 @@ export default class Tasks extends Component {
const { tasks } = this.props;
return (
diff --git a/src/tasks/task.js b/src/tasks/task.js
index 5337390..29261b6 100644
--- a/src/tasks/task.js
+++ b/src/tasks/task.js
@@ -4,7 +4,8 @@ function _getAveragesFromTask(task) {
(acc, result) => {
acc.statuses[result.status] += 1;
acc.total_duration += parseFloat(result.duration);
- acc.average_duration = acc.total_duration / results.length;
+ acc.average_duration =
+ Math.round((acc.total_duration * 100) / results.length) / 100;
return acc;
},
{
diff --git a/src/tasks/task.test.js b/src/tasks/task.test.js
index a0f5be0..ff4e6b4 100644
--- a/src/tasks/task.test.js
+++ b/src/tasks/task.test.js
@@ -100,7 +100,7 @@ test("extractTasksFromPlays", () => {
{
name: "Gathering Facts",
action: "gather_facts",
- average_duration: 1.702101,
+ average_duration: 1.7,
statuses: {
ok: 1,
failed: 0,
@@ -125,7 +125,7 @@ test("extractTasksFromPlays", () => {
{
name: "Gathering Facts",
action: "gather_facts",
- average_duration: 1.296572,
+ average_duration: 1.3,
statuses: {
ok: 3,
failed: 0,
@@ -161,7 +161,7 @@ test("extractTasksFromPlays", () => {
ended: "2019-05-17T16:55:12.195753",
status: "ok"
}
- ],
+ ]
}
];
expect(extractTasksFromPlays(plays)).toEqual(expectedTasks);