Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviomacedo committed May 14, 2023
1 parent dc7637b commit f2d8578
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ exactly how the service times are distributed:
![](./docs/img/basic-usage-distribution.png)

As we would expect, the shape of the graph resembles that of an exponential
distribution. The mean time in this particular simulation was about 20.2
distribution. The mean time in this particular simulation was about 20
minutes, compared to the average 15 minutes to run a job. The extra 5 minutes or
so were spent by the jobs waiting in the queue.

Expand Down Expand Up @@ -139,7 +139,7 @@ const report = simulator.simulate([{
```

As the simulation report shows, both departments have to wait about the same
amount of time (approximately 21.5 min), on average, for their jobs to finish.
amount of time (approximately 19.5 min), on average, for their jobs to finish.
This is because the default scheduling policy for a job queue is first-in,
first-out (FIFO), so every job, regardless of their share identifier, has to
wait for the same number of jobs in the queue, on average.
Expand Down Expand Up @@ -171,7 +171,7 @@ const queue: batch.JobQueue = new batch.JobQueue(this, 'myJobQueue', {
});
```

The resulting distributions are about 21 minutes for Finance and 17 minutes for
The resulting mean times are about 22 minutes for Finance and 16 minutes for
Research:

![](./docs/img/fairshare-finance-distribution.png)
Expand Down Expand Up @@ -209,7 +209,7 @@ const report = simulator.simulate([{
}]);
```

And then run a simulation, which shows that the mean time jumps to almost 30
And then run a simulation, which shows that the mean time jumps to about 29
minutes, in this case:

![](./docs/img/retries-distribution.png)
Expand Down
Binary file modified docs/img/basic-usage-distribution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/basic-usage-queue-size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/fairshare-finance-distribution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/fairshare-research-distribution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/fifo-finance-distribution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/fifo-research-distribution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/retries-distribution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion src/simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,17 @@ export class SimulationReport {
},
};
var chart = type === 'Line' ? new google.visualization.LineChart(document.getElementById(id)) : new google.visualization.Histogram(document.getElementById(id));
google.visualization.events.addListener(chart, 'ready', function () {
const div = document.getElementById(id);
div.innerHTML = '<img src="' + chart.getImageURI() + '">';
});
chart.draw(data, options);
}
function drawCharts() {
${generateCalls()}
}
</script>
</head>
Expand Down

0 comments on commit f2d8578

Please sign in to comment.