35 : void
36 {
37 $db = $environment->
getResource(Environment::RESOURCE_DATABASE);
38 $client_ini = $environment->
getResource(Environment::RESOURCE_CLIENT_INI);
39
40 if (!$client_ini) {
41 return;
42 }
43
45
46 $service = $config->getAdaptorName();
48 "service",
50 "The backend that is used for the ILIAS cache."
51 );
53 "active",
54 $config->isActivated()
55 );
56
57 $servers = $config->getNodes();
58 if (
60 $servers !== []
61 ) {
62 $server_collection = [];
65 Metric::STABILITY_CONFIG,
66 Metric::TYPE_TEXT,
68 );
70 Metric::STABILITY_CONFIG,
71 Metric::TYPE_GAUGE,
73 );
75 Metric::STABILITY_CONFIG,
76 Metric::TYPE_GAUGE,
78 );
79
80 $server_collection[] =
new Metric(
81 Metric::STABILITY_CONFIG,
82 Metric::TYPE_COLLECTION,
83 [
84 "host" => $host,
85 "port" => $port,
86 "weight" => $weight
87 ],
88 "Configured memcached node."
89 );
90 }
91
93 Metric::STABILITY_CONFIG,
94 Metric::TYPE_COLLECTION,
95 $server_collection,
96 "Collection of configured memcached nodes."
97 );
99 }
100
101 $component_activation = [];
102 foreach (ilGlobalCache::getAvailableComponents() as $component) {
103 $component_activation[$component] =
new Metric(
104 Metric::STABILITY_CONFIG,
105 Metric::TYPE_BOOL,
106 $config->isComponentActivated($component)
107 );
108 }
109 $component_activation =
new Metric(
110 Metric::STABILITY_CONFIG,
111 Metric::TYPE_COLLECTION,
112 $component_activation,
113 "Which components are activated to use caching?"
114 );
116 "components",
117 $component_activation
118 );
119 }
A metric is something we can measure about the system.
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
store(string $key, Metric $metric)
Store some metric in the storage.
storeConfigText(string $key, string $value, ?string $description=null)
storeConfigBool(string $key, bool $value, ?string $description=null)