It would be helpful to aggregate metrics produced by rust-code-analysis on different files in a single global file. The aggregation should be done according to the languages contained in a determined directory.
To do so, a possible approach with threads could be the following one:
Each thread computes the metrics for a single file and then sends the result to a handler which implements a specific trait called HandlerTrait.
HandlerTrait contains two functions:
merge is called by each thread at the end of its execution and adds the result of each thread to a global vector called Vec
finalize instead is called when each thread has finished to be run and dumps the content of Vec in the required format
It would be helpful to aggregate metrics produced by
rust-code-analysis
on different files in a single global file. The aggregation should be done according to the languages contained in a determined directory. To do so, a possible approach with threads could be the following one:Each thread computes the metrics for a single file and then sends the result to a handler which implements a specific trait called
HandlerTrait
.HandlerTrait
contains two functions:merge
is called by each thread at the end of its execution and adds the result of each thread to a global vector calledVec
finalize
instead is called when each thread has finished to be run and dumps the content ofVec
in the required format