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

save test results to csv #2

Closed
radlinskii opened this issue Sep 29, 2023 · 5 comments · Fixed by #25
Closed

save test results to csv #2

radlinskii opened this issue Sep 29, 2023 · 5 comments · Fixed by #25
Assignees

Comments

@radlinskii
Copy link
Owner

Would be really useful to save results of the test that has run into a file so that results can be displayed and compared later on.

This issue is only about writing to a file.
File location can be, ~/.config/donkeytype/results.csv, because this folder is already used for config file.
.csv seems to be the best extension for this purpose.
If the file doesn't exist it should be created.

Different values that are currently displayed in src/main.rs after the test is finished should be added as columns into the csv.
Information about settings should also be included, (currently only duration, and numbers if numbers where present). Later might be beneficial to have this data for filtering the results.

serde crate should be used for this purpose, it is already a dependency.

@AmeyaVerma
Copy link

@radlinskii I can fix this please assign me with it

@radlinskii
Copy link
Owner Author

Great, good luck!

@radlinskii
Copy link
Owner Author

There is no error here. This issue is about implementing the feature of writing the results that you get at the end of the main function

donkeytype/src/main.rs

Lines 97 to 113 in 3e2b48c

Ok(stats) => {
println!("WPM: {:.2}", stats.wpm);
println!("Raw accuracy: {:.2}%", stats.raw_accuracy);
println!("Raw valid characters: {}", stats.raw_valid_characters_count);
println!("Raw mistakes: {}", stats.raw_mistakes_count);
println!("Raw characters typed: {}", stats.raw_typed_characters_count);
println!("Accuracy after corrections: {:.2}%", stats.accuracy);
println!(
"Valid characters after corrections: {}",
stats.valid_characters_count
);
println!("Mistakes after corrections: {}", stats.mistakes_count);
println!(
"Characters typed after corrections: {}",
stats.typed_characters_count
);
println!("Time: {} seconds", duration);
to a file so that they can be displayed later on.

@nisargparikh69
Copy link

@radlinskii I have raised PR kindly review

@radlinskii
Copy link
Owner Author

Hey, @nisargparikh69 I've already took care of it, but I've added hacktoberfest-accepted label to your PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants