ILIAS  release_8 Revision v8.24
ilDatabaseUpdateStepsMetricsCollectedObjective Class Reference
+ Inheritance diagram for ilDatabaseUpdateStepsMetricsCollectedObjective:
+ Collaboration diagram for ilDatabaseUpdateStepsMetricsCollectedObjective:

Public Member Functions

 __construct (Storage $storage, ilDatabaseUpdateSteps $steps)
 
 getHash ()
 
 getLabel ()
 

Data Fields

const STEP_METHOD_PREFIX = "step_"
 

Protected Member Functions

 collectFrom (Setup\Environment $environment, Storage $storage)
 
 getTentativePreconditions (Setup\Environment $environment)
 

Protected Attributes

string $step_class
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDatabaseUpdateStepsMetricsCollectedObjective::__construct ( Storage  $storage,
ilDatabaseUpdateSteps  $steps 
)

Definition at line 31 of file class.ilDatabaseUpdateStepsMetricsCollectedObjective.php.

32 {
33 parent::__construct($storage);
34 $this->step_class = get_class($steps);
35 }
$steps
Definition: latex.php:3
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $steps, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ collectFrom()

ilDatabaseUpdateStepsMetricsCollectedObjective::collectFrom ( Setup\Environment  $environment,
Storage  $storage 
)
protected

Definition at line 37 of file class.ilDatabaseUpdateStepsMetricsCollectedObjective.php.

37 : void
38 {
39 $execution_log = $environment->getResource(ilDatabaseUpdateStepExecutionLog::class);
40 $step_reader = $environment->getResource(ilDBStepReader::class);
41
42 $version = new Metric(
43 Metric::STABILITY_STABLE,
44 Metric::TYPE_TEXT,
45 (string) ($execution_log->getLastFinishedStep($this->step_class))
46 );
47
48 $available_version = new Metric(
49 Metric::STABILITY_STABLE,
50 Metric::TYPE_TEXT,
51 (string) $step_reader->getLatestStepNumber($this->step_class, self::STEP_METHOD_PREFIX)
52 );
53
54 $update_required = new Metric(
55 Metric::STABILITY_STABLE,
56 Metric::TYPE_BOOL,
57 $execution_log->getLastFinishedStep($this->step_class) !== $step_reader->getLatestStepNumber(
58 $this->step_class,
59 self::STEP_METHOD_PREFIX
60 )
61 );
62
63 $collection = new Metric(
64 Metric::STABILITY_STABLE,
65 Metric::TYPE_COLLECTION,
66 [
67 "version" => $version,
68 "available_version" => $available_version,
69 "update_required" => $update_required
70 ]
71 );
72
73 $storage->store($this->step_class, $collection);
74 }
$version
Definition: plugin.php:24
A metric is something we can measure about the system.
Definition: Metric.php:34
store(string $key, Metric $metric)
Store some metric in the storage.

References $version, and ILIAS\Setup\Metrics\Storage\store().

+ Here is the call graph for this function:

◆ getHash()

ilDatabaseUpdateStepsMetricsCollectedObjective::getHash ( )

Definition at line 86 of file class.ilDatabaseUpdateStepsMetricsCollectedObjective.php.

86 : string
87 {
88 return hash("sha256", static::class . $this->step_class);
89 }

◆ getLabel()

ilDatabaseUpdateStepsMetricsCollectedObjective::getLabel ( )

Definition at line 91 of file class.ilDatabaseUpdateStepsMetricsCollectedObjective.php.

91 : string
92 {
93 return "Status of database update steps in " . $this->step_class;
94 }

References $step_class.

◆ getTentativePreconditions()

Field Documentation

◆ $step_class

string ilDatabaseUpdateStepsMetricsCollectedObjective::$step_class
protected

Definition at line 29 of file class.ilDatabaseUpdateStepsMetricsCollectedObjective.php.

Referenced by getLabel().

◆ STEP_METHOD_PREFIX

const ilDatabaseUpdateStepsMetricsCollectedObjective::STEP_METHOD_PREFIX = "step_"

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