Skip to content

Aggregate metrics according to their language #163

Description

@Luni-4

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

Activity

  1. calixteman commented on Apr 28, 2020

    @calixteman
    Collaborator

    The trait could be more general:

    • just add a result and do whatever you want with it: merge with prev results, dump it, write it in a file, ...
    • and finalize: which could do nothing or produce a final report
      Probably Handler isn't a good name
  2. Luni-4 commented on Jul 1, 2020

    @Luni-4
    CollaboratorAuthor

    It would be helpful to dump the aggregate metrics through the Tokei tabular output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions