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 granular data to the HTML report graphs #415

Merged

Conversation

slashrsm
Copy link
Collaborator

@slashrsm slashrsm commented Jan 5, 2022

Closes #410.

I used the default color scheme for now. I don't particularly like it, but I didn't have any better idea either.

Screenshot 2022-02-10 at 23 34 32

Screenshot 2022-02-10 at 23 34 18

@slashrsm slashrsm force-pushed the 410_granular_graph_metrics branch from d0ec6c8 to 1f1f6ac Compare January 21, 2022 09:26
@slashrsm slashrsm force-pushed the 410_granular_graph_metrics branch from bd61dc6 to c2908ac Compare February 10, 2022 12:08
@slashrsm slashrsm marked this pull request as ready for review February 10, 2022 20:36
Copy link
Member

@jeremyandrews jeremyandrews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very excited to see this coming together! It'll provide much more insight into load test results.

src/graph.rs Outdated Show resolved Hide resolved
src/graph.rs Outdated Show resolved Hide resolved
src/graph.rs Outdated
pub(crate) fn get_tasks_per_second_graph(&self) -> Graph<usize> {
self.create_graph_from_data("graph-tps", "Tasks #", &self.tasks_per_second)
pub(crate) fn get_tasks_per_second_graph(&self) -> Graph<usize, usize> {
self.create_graph_from_single_data("graph-tps", "Tasks #", self.tasks_per_second.clone())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is tasks_per_second using single_data? It's useful to see more granular data if possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on what should we divide tasks?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per-task?

src/graph.rs Outdated
let mut legend = vec!["Total"];

let mut other_values = String::new();
for (title, sub_data) in self.data.iter() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we sort these by #, so for example the request that makes the most requests in the graph comes first in this legend, the request that makes the second most requests come second, and so on? Otherwise I'm finding it very difficult to match of lines with the legend and to enable/disable specific elements.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(As a reference: this is sorting by name, but likely we can use the same general mechanism to sort by #: https://github.com/tag1consulting/goose/blob/main/src/metrics.rs#L985)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -331,7 +382,7 @@ impl<'a, T: Serialize> Graph<'a, T> {
var myChart = echarts.init(chartDom);

myChart.setOption({{
color: ['#2c664f'],
color: ['#2c664f', '#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if there are more than 10 elements on the graph, do we re-use the colors?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. We could add more, but at some point they will start repeating anyway.

Maybe there is a way to set these programmatically? A follow-up maybe?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Followup works. Can you create an issue for this?

src/graph.rs Outdated Show resolved Hide resolved
src/graph.rs Outdated Show resolved Hide resolved
src/graph.rs Show resolved Hide resolved
@jeremyandrews
Copy link
Member

How difficult would it be to add a flag to disable this verbose data? It creates much larger report files, and perhaps some would prefer the simpler and smaller graphs that we've generated up to this PR? I'd leave granular data enabled by default, but it could be useful to have an option like --no-granular-data or something, especially useful on larger/longer load tests?

@nicompte
Copy link
Contributor

Hello there, just a suggestion after testing your branch, do you think it would be possible to keep the same color for the same request, between two runs?

@slashrsm slashrsm force-pushed the 410_granular_graph_metrics branch from 32f17fb to 37babb5 Compare March 17, 2022 09:57
@slashrsm slashrsm force-pushed the 410_granular_graph_metrics branch from 37babb5 to 7478a19 Compare March 23, 2022 15:59
@slashrsm slashrsm force-pushed the 410_granular_graph_metrics branch from 7478a19 to d1a0b6d Compare March 23, 2022 16:02
@slashrsm
Copy link
Collaborator Author

I added --no-granular-data configuration option.

Hello there, just a suggestion after testing your branch, do you think it would be possible to keep the same color for the same request, between two runs?

Good point. I added ordering to the lines/legend based on the numbers behind them. I suspect that same order also means same colors so this might solve your suggestion too. @nicompte Do you mind testing a bit?

@slashrsm slashrsm requested a review from jeremyandrews March 24, 2022 17:11
@slashrsm slashrsm force-pushed the 410_granular_graph_metrics branch from 7fb42a6 to 0e8ce09 Compare March 24, 2022 17:57
@nicompte
Copy link
Contributor

Good point. I added ordering to the lines/legend based on the numbers behind them. I suspect that same order also means same colors so this might solve your suggestion too. @nicompte Do you mind testing a bit?

Works great thanks!

@@ -59,6 +59,7 @@ const DEFAULT_PORT: &str = "5115";
/// --no-error-summary Doesn't display an error summary
/// --no-print-metrics Doesn't display metrics at end of load test
/// --report-file NAME Create an html-formatted report
/// --no-granular-data Disables granular data in HTML report graphs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would --no-granular-report make it more clear that this specifically impacts --report-file and no other data?

/// represents one second.
users_per_second: Vec<usize>,
/// Counts requests per second for each request type.
requests_per_second: HashMap<String, TimeSeries<u32, u32>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Followup is fine) it seems worthwhile to create a custom Type for HashMap<String, TimeSeries<u32, u32>>, something like ItemsPerSecond or PerSecondCounter or ...? I see it throughout the new code, and we'd document it thoroughly where the type is created.

Copy link
Member

@jeremyandrews jeremyandrews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks! I'm doing more testing, but there's nothing blocking a merge now. I think the configuration option change is worthwhile to be more clear

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.

Display more granular data on graphs
3 participants