ILIAS  release_7 Revision v7.30-3-g800a261c036
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
 

Detailed Description

Base class to simplify collection of metrics.

Definition at line 12 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 71 of file CollectedObjective.php.

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

71  : Setup\Environment
72  {
73  $this->collectFrom($environment, $this->storage);
74  return $environment;
75  }
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 46 of file CollectedObjective.php.

46  : string
47  {
48  return hash("sha256", static::class);
49  }

◆ getLabel()

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

Get a label that describes this objective.

Implements ILIAS\Setup\Objective.

Definition at line 51 of file CollectedObjective.php.

51  : string
52  {
53  return "Collect metrics.";
54  }

◆ getPreconditions()

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

Definition at line 61 of file CollectedObjective.php.

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

61  : array
62  {
63  return array_map(
64  function (Setup\Objective $o) {
65  return new Setup\Objective\Tentatively($o);
66  },
67  $this->getTentativePreconditions($environment)
68  );
69  }
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 80 of file CollectedObjective.php.

80  : bool
81  {
82  // We want to always collect fresh metrics.
83  return true;
84  }

◆ 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 56 of file CollectedObjective.php.

56  : bool
57  {
58  return false;
59  }

Field Documentation

◆ $storage

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

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