watch_feat_stats Module

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.


Uses

  • module~~watch_feat_stats~~UsesGraph module~watch_feat_stats watch_feat_stats module~watch_feature_api watch_feature_api module~watch_feat_stats->module~watch_feature_api module~watch_log watch_log module~watch_feat_stats->module~watch_log module~watch_types watch_types module~watch_feat_stats->module~watch_types module~watch_feature_api->module~watch_types fpm_strings fpm_strings module~watch_feature_api->fpm_strings iso_fortran_env iso_fortran_env module~watch_feature_api->iso_fortran_env module~watch_log->module~watch_types face face module~watch_log->face module~watch_log->iso_fortran_env fpm_command_line fpm_command_line module~watch_types->fpm_command_line module~watch_types->fpm_strings module~watch_types->iso_fortran_env

Used by

  • module~~watch_feat_stats~~UsedByGraph module~watch_feat_stats watch_feat_stats module~watch_feature_factory watch_feature_factory module~watch_feature_factory->module~watch_feat_stats module~watch_engine watch_engine module~watch_engine->module~watch_feature_factory

Derived Types

type, private, extends(watch_feature_t) ::  stats_feature_t

A feature that counts how many command runs have completed.

Components

Type Visibility Attributes Name Initial
integer, public :: runs = 0

Type-Bound Procedures

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

Subroutines

public subroutine new_stats_feature(f)

Allocate a new stats feature instance.

Arguments

Type IntentOptional Attributes Name
class(watch_feature_t), intent(out), allocatable :: f

private subroutine stats_after(self, exitstat, seconds)

Update run counter after each completed command execution.

Read more…

Arguments

Type IntentOptional Attributes Name
class(stats_feature_t), intent(inout) :: self
integer, intent(in) :: exitstat
real, intent(in) :: seconds

private subroutine stats_init(self, cfg)

Initialize the stats feature.

Read more…

Arguments

Type IntentOptional Attributes Name
class(stats_feature_t), intent(inout) :: self
type(watch_config_t), intent(in) :: cfg