ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Test\Setup\DatabaseInconsistencyMetricsCollectedObjective Class Reference
+ Inheritance diagram for ILIAS\Test\Setup\DatabaseInconsistencyMetricsCollectedObjective:
+ Collaboration diagram for ILIAS\Test\Setup\DatabaseInconsistencyMetricsCollectedObjective:

Protected Member Functions

 getTentativePreconditions (Environment $environment)
 
 collectFrom (Environment $environment, Storage $storage)
 
 collectMantis37759 (array &$metrics, \ilDBInterface $db)
 
- Protected Member Functions inherited from ILIAS\Setup\Metrics\CollectedObjective
 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...
 

Additional Inherited Members

- Public Member Functions inherited from ILIAS\Setup\Metrics\CollectedObjective
 __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
 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 (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 Attributes inherited from ILIAS\Setup\Metrics\CollectedObjective
Storage $storage
 

Detailed Description

Member Function Documentation

◆ collectFrom()

ILIAS\Test\Setup\DatabaseInconsistencyMetricsCollectedObjective::collectFrom ( Environment  $environment,
Storage  $storage 
)
protected

Definition at line 40 of file DatabaseInconsistencyMetricsCollectedObjective.php.

40 : void
41 {
42 $db = $environment->getResource(Environment::RESOURCE_DATABASE);
43 $metrics = [
44 'database_available' => new Metric(
47 !is_null($db),
48 'This metric is a canary to check for the general existence of this collection.'
49 )
50 ];
51
52 if ($db) {
53 $this->collectMantis37759($metrics, $db);
54 }
55
56 $storage->store('database_inconsistencies', new Metric(
59 $metrics,
60 'These metrics collect information about inconsistencies in the database of the T&A.'
61 ));
62 }
const TYPE_BOOL
The type of the metric tells what to expect of the values.
Definition: Metric.php:53
store(string $key, Metric $metric)
Store some metric in the storage.

References ILIAS\$db, ILIAS\Setup\Metrics\CollectedObjective\$storage, ILIAS\Test\Setup\DatabaseInconsistencyMetricsCollectedObjective\collectMantis37759(), ILIAS\Setup\Environment\getResource(), ILIAS\Setup\Environment\RESOURCE_DATABASE, ILIAS\Setup\Metrics\Metric\STABILITY_MIXED, ILIAS\Setup\Metrics\Metric\STABILITY_VOLATILE, ILIAS\Setup\Metrics\Storage\store(), ILIAS\Setup\Metrics\Metric\TYPE_BOOL, and ILIAS\Setup\Metrics\Metric\TYPE_COLLECTION.

+ Here is the call graph for this function:

◆ collectMantis37759()

ILIAS\Test\Setup\DatabaseInconsistencyMetricsCollectedObjective::collectMantis37759 ( array &  $metrics,
\ilDBInterface  $db 
)
protected

Definition at line 64 of file DatabaseInconsistencyMetricsCollectedObjective.php.

65 {
66 $result = $db->query('
67 SELECT COUNT(*) as cnt
68 FROM tst_active
69 LEFT JOIN object_data ON tst_active.test_fi = object_data.obj_id
70 WHERE object_data.obj_id IS NULL
71 ');
72
73 $metrics["mantis_37759"] = new Metric(
76 $db->fetchAssoc($result)['cnt'],
77 'Measures active tests runs where the corresponding Test object does not exist anymore.'
78 );
79 }

References ILIAS\$db, ILIAS\Setup\Metrics\Metric\STABILITY_VOLATILE, and ILIAS\Setup\Metrics\Metric\TYPE_GAUGE.

Referenced by ILIAS\Test\Setup\DatabaseInconsistencyMetricsCollectedObjective\collectFrom().

+ Here is the caller graph for this function:

◆ getTentativePreconditions()

ILIAS\Test\Setup\DatabaseInconsistencyMetricsCollectedObjective::getTentativePreconditions ( Environment  $environment)
protected
Returns
array<\ilDatabaseInitializedObjective|\ilIniFilesLoadedObjective>

Definition at line 33 of file DatabaseInconsistencyMetricsCollectedObjective.php.

33 : array
34 {
35 return [
36 new \ilDatabaseInitializedObjective()
37 ];
38 }

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