ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Setup\Metrics\CollectedObjective Class Reference

Base class to simplify collection of metrics. More...

+ Inheritance diagram for ILIAS\Setup\Metrics\CollectedObjective:
+ Collaboration diagram for ILIAS\Setup\Metrics\CollectedObjective:

Public Member Functions

 __construct (Storage $storage)
 
 getHash ()
 Get a hash for this objective. More...
 
 getLabel ()
 Get a label that describes this objective. More...
 
 isNotable ()
 Get to know if this is an interesting objective for a human. More...
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 
- Public Member Functions inherited from ILIAS\Setup\Objective
 getPreconditions (Environment $environment)
 Objectives might depend on other objectives. More...
 
 achieve (Environment $environment)
 Objectives can be achieved. More...
 
 isApplicable (Environment $environment)
 Get to know whether the objective is applicable. More...
 

Protected Member Functions

 collectFrom (Setup\Environment $environment, Storage $storage)
 Attempt to gather metrics based on the provided environment. More...
 
 getTentativePreconditions (Setup\Environment $environment)
 Give preconditions that might or might not be fullfilled. More...
 

Protected Attributes

Storage $storage
 

Detailed Description

Base class to simplify collection of metrics.

Definition at line 28 of file CollectedObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Setup\Metrics\CollectedObjective::__construct ( Storage  $storage)

Member Function Documentation

◆ achieve()

ILIAS\Setup\Metrics\CollectedObjective::achieve ( Setup\Environment  $environment)

Definition at line 82 of file CollectedObjective.php.

References ILIAS\Setup\Metrics\CollectedObjective\collectFrom().

82  : Setup\Environment
83  {
84  $this->collectFrom($environment, $this->storage);
85  return $environment;
86  }
collectFrom(Setup\Environment $environment, Storage $storage)
Attempt to gather metrics based on the provided environment.
+ Here is the call graph for this function:

◆ collectFrom()

ILIAS\Setup\Metrics\CollectedObjective::collectFrom ( Setup\Environment  $environment,
Storage  $storage 
)
abstractprotected

Attempt to gather metrics based on the provided environment.

Make sure to be very cautious regarding expectations towards the environment. It might only be initialized partially or not be initialized at all, since preconditions might not have been met. This should be implemented with a best effort approach to gather as much metrics as possible even when the installation is damaged.

Referenced by ILIAS\Setup\Metrics\CollectedObjective\__construct(), and ILIAS\Setup\Metrics\CollectedObjective\achieve().

+ Here is the caller graph for this function:

◆ getHash()

ILIAS\Setup\Metrics\CollectedObjective::getHash ( )

Get a hash for this objective.

The hash of two objectives must be the same, if they are the same objective, with the same config on the same environment, i.e. if the one is achieved the other is achieved as well because they are the same.

Implements ILIAS\Setup\Objective.

Definition at line 59 of file CollectedObjective.php.

59  : string
60  {
61  return hash("sha256", static::class);
62  }

◆ getLabel()

ILIAS\Setup\Metrics\CollectedObjective::getLabel ( )

Get a label that describes this objective.

Implements ILIAS\Setup\Objective.

Definition at line 64 of file CollectedObjective.php.

64  : string
65  {
66  return "Collect metrics: " . get_class($this);
67  }

◆ getPreconditions()

ILIAS\Setup\Metrics\CollectedObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 74 of file CollectedObjective.php.

References ILIAS\Setup\Metrics\CollectedObjective\getTentativePreconditions().

74  : array
75  {
76  return array_map(
77  fn (Setup\Objective $o): \ILIAS\Setup\Objective\Tentatively => new Setup\Objective\Tentatively($o),
78  $this->getTentativePreconditions($environment)
79  );
80  }
Class ChatMainBarProvider .
getTentativePreconditions(Setup\Environment $environment)
Give preconditions that might or might not be fullfilled.
+ Here is the call graph for this function:

◆ getTentativePreconditions()

ILIAS\Setup\Metrics\CollectedObjective::getTentativePreconditions ( Setup\Environment  $environment)
abstractprotected

Give preconditions that might or might not be fullfilled.

Since collection of metrics should also work in (partially) broken installations the preconditions given here will only be tentatively fullfilled when collectFrom is called.

Returns
Setup[]

Referenced by ILIAS\Setup\Metrics\CollectedObjective\__construct(), and ILIAS\Setup\Metrics\CollectedObjective\getPreconditions().

+ Here is the caller graph for this function:

◆ isApplicable()

ILIAS\Setup\Metrics\CollectedObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 88 of file CollectedObjective.php.

88  : bool
89  {
90  // We want to always collect fresh metrics.
91  return true;
92  }

◆ isNotable()

ILIAS\Setup\Metrics\CollectedObjective::isNotable ( )

Get to know if this is an interesting objective for a human.

Implements ILIAS\Setup\Objective.

Definition at line 69 of file CollectedObjective.php.

69  : bool
70  {
71  return false;
72  }

Field Documentation

◆ $storage

Storage ILIAS\Setup\Metrics\CollectedObjective::$storage
protected

The documentation for this class was generated from the following file: