ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestDatabaseInconsistencyMetricsCollectedObjective Class Reference
+ Inheritance diagram for ilTestDatabaseInconsistencyMetricsCollectedObjective:
+ Collaboration diagram for ilTestDatabaseInconsistencyMetricsCollectedObjective:

Protected Member Functions

 getTentativePreconditions (Setup\Environment $environment)
 
 collectFrom (Setup\Environment $environment, Setup\Metrics\Storage $storage)
 
 collectMantis37759 (array &$metrics, \ilDBInterface $db)
 

Detailed Description

Member Function Documentation

◆ collectFrom()

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

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

References collectMantis37759().

37  : void
38  {
39  $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
40  $metrics = [
41  "database_available" => new Metric(
42  Metric::STABILITY_VOLATILE,
43  Metric::TYPE_BOOL,
44  !is_null($db),
45  "This metric is a canary to check for the general existence of this collection."
46  )
47  ];
48 
49  if ($db) {
50  $this->collectMantis37759($metrics, $db);
51  }
52 
53  $storage->store("database_inconsistencies", new Metric(
54  Metric::STABILITY_MIXED,
55  Metric::TYPE_COLLECTION,
56  $metrics,
57  "These metrics collect information about inconsistencies in the database of the T&A."
58  ));
59  }
A metric is something we can measure about the system.
Definition: Metric.php:33
+ Here is the call graph for this function:

◆ collectMantis37759()

ilTestDatabaseInconsistencyMetricsCollectedObjective::collectMantis37759 ( array &  $metrics,
\ilDBInterface  $db 
)
protected

Definition at line 61 of file class.ilTestDatabaseInconsistencyMetricsCollectedObjective.php.

References ilDBInterface\fetchAssoc(), and ilDBInterface\query().

Referenced by collectFrom().

62  {
63  $result = $db->query("
64  SELECT COUNT(*) as cnt
65  FROM tst_active
66  LEFT JOIN object_data ON tst_active.test_fi = object_data.obj_id
67  WHERE object_data.obj_id IS NULL
68  ");
69 
70  $metrics["mantis_37759"] = new Metric(
71  Metric::STABILITY_VOLATILE,
72  Metric::TYPE_GAUGE,
73  $db->fetchAssoc($result)["cnt"],
74  "Measures active tests runs where the corresponding Test object does not exist anymore."
75  );
76  }
A metric is something we can measure about the system.
Definition: Metric.php:33
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTentativePreconditions()

ilTestDatabaseInconsistencyMetricsCollectedObjective::getTentativePreconditions ( Setup\Environment  $environment)
protected
Returns
array<|>

Definition at line 30 of file class.ilTestDatabaseInconsistencyMetricsCollectedObjective.php.

30  : array
31  {
32  return [
33  new \ilDatabaseInitializedObjective()
34  ];
35  }

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