2024-10-17 14:27:08 +00:00
# Backend internal interview (rust)
## CHANGES: fixed branch
- Moving from **HashMap** to **BTreeMap** to preseve loading lines order.
- Fix **lines parser** in Maps **metrics** and in **aggregated_metrics** to be handled properly.
- Fix **unwrap / expect** for obvious reasons, add simple error message via **map_err** , **unwrap_or_else** and **closure function** .
- Fix some source code lines order, output format and conversions.
- Change some **iterators** to < u > functional mode</ u > .
- Separate tasks to independent funtions for better isolation, less responsibilities and help on **tests** handling.
- Adding **output_path** to help on result output options.
- Following **unit tests** are implemented:
- < u > test_load_input</ u > test load input file **input.txt** .
- < u > test_invalid_line_value</ u > test use invalid value in line parsing.
- < u > test_invalid_line</ u > test use invlid value in line parsing.
- < u > test_expected_metrics</ u > test load input data from **input.txt** compare with **output_expected.txt** .
2024-10-17 14:48:56 +00:00
> [!Note]
> Code simply **works as expected** <br>
> It is not be able to **process multiple metrics in parallel** yet. <br>
> A full refactoring has to be done for <u>better quality, maintenance and be more readable</u>. (Structs, implementaitions, settings for multiple inputs, etc). <br>
2024-10-17 14:27:08 +00:00
Next round in: [Improve branch ](/NewRelic/be-technical-interview-rust/src/branch/improved )