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

Simple mechanism for collecting statistics during execution #47

Merged
merged 2 commits into from
May 17, 2023

Conversation

cmnrd
Copy link
Contributor

@cmnrd cmnrd commented May 16, 2023

This adds a simple class that can be used to (optionally) collect statistics about a program execution. This includes information bout the program (e.g. number of reactors, reactions, posts, etc) and about the execution (e.g. number of processed events and reactions as well as the number of actions triggered).

@cmnrd cmnrd requested a review from tanneberger May 16, 2023 13:21
cmnrd added 2 commits May 17, 2023 10:22
This adds a simple class that can be used to (optionally) collect statistics
about a program execution. This includes information bout the program (e.g.
number of reactors, reactions, posts, etc) and about the execution (e.g. number
of processed events and reactions as well as the number of actions triggered).
@cmnrd cmnrd merged commit c8c9590 into master May 17, 2023
@cmnrd cmnrd deleted the statistics branch May 17, 2023 11:04
cmnrd added a commit to lf-lang/lingua-franca that referenced this pull request May 17, 2023
This adds the `print-statistics` target property and pulls in
lf-lang/reactor-cpp#47. If `print-statistics` is true,
the compiled program will print an output like the following when the program
terminates.

```
[INFO]  -----------------------------------------------------------
[INFO]  Program statistics:
[INFO]    - number of reactors:    4
[INFO]    - number of connections: 4
[INFO]    - number of reactions    9
[INFO]    - number of actions:     11
[INFO]    - number of ports:       8
[INFO]  Execution statistics:
[INFO]    - processed events:      12000015
[INFO]    - triggered actions:     12000021
[INFO]    - processed reactions:   36000039
[INFO]    - set ports:             24000024
[INFO]    - scheduled actions:     12000021
[INFO]  -----------------------------------------------------------
```
@lhstrh
Copy link
Member

lhstrh commented May 17, 2023

Very clean! Nice!

cmnrd added a commit to lf-lang/lingua-franca that referenced this pull request May 18, 2023
This adds the `print-statistics` target property and pulls in
lf-lang/reactor-cpp#47. If `print-statistics` is true,
the compiled program will print an output like the following when the program
terminates.

```
[INFO]  -----------------------------------------------------------
[INFO]  Program statistics:
[INFO]    - number of reactors:    4
[INFO]    - number of connections: 4
[INFO]    - number of reactions    9
[INFO]    - number of actions:     11
[INFO]    - number of ports:       8
[INFO]  Execution statistics:
[INFO]    - processed events:      12000015
[INFO]    - triggered actions:     12000021
[INFO]    - processed reactions:   36000039
[INFO]    - set ports:             24000024
[INFO]    - scheduled actions:     12000021
[INFO]  -----------------------------------------------------------
```
@cmnrd cmnrd added the feature New feature label Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants