Example "stats" feature plugin.
This feature demonstrates the plugin system by tracking the number of runs. It currently does not print or export statistics; it simply increments an internal counter after each run.
The exitstat and seconds arguments are accepted to conform to the plugin
interface. Dummy references are used to prevent unused-argument warnings.
A feature that counts how many command runs have completed.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | runs | = | 0 |
| procedure, public :: init => stats_init | |
| procedure, public :: on_after_run => stats_after | |
| procedure, public :: on_before_run => feat_before_noop | |
| procedure, public :: on_change_detected => feat_change_noop | |
| procedure, public :: on_manifest_changed => feat_manifest_noop | |
| procedure, public :: on_start => feat_noop | |
| procedure, public :: on_watch_list_built => feat_list_noop |
Allocate a new stats feature instance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(watch_feature_t), | intent(out), | allocatable | :: | f |
Update run counter after each completed command execution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(stats_feature_t), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | exitstat | |||
| real, | intent(in) | :: | seconds |
Initialize the stats feature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(stats_feature_t), | intent(inout) | :: | self | |||
| type(watch_config_t), | intent(in) | :: | cfg |