ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\Setup\Metrics\ArrayStorage Class Reference
+ Inheritance diagram for ILIAS\Setup\Metrics\ArrayStorage:
+ Collaboration diagram for ILIAS\Setup\Metrics\ArrayStorage:

Public Member Functions

 __construct ()
 
 store (string $key, Metric $metric)
 @inheritdocs More...
 
 get ()
 
 asMetric ()
 
- Public Member Functions inherited from ILIAS\Setup\Metrics\Storage
 store (string $key, Metric $metric)
 Store some metric in the storage. More...
 
 storeConfigBool ($key, bool $value, string $description=null)
 
 storeConfigCounter ($key, int $value, string $description=null)
 
 storeConfigGauge ($key, $value, string $description=null)
 
 storeConfigTimestamp ($key, \DateTimeImmutable $value, string $description=null)
 
 storeConfigText ($key, string $value, string $description=null)
 
 storeStableBool ($key, bool $value, string $description=null)
 
 storeStableCounter ($key, int $value, string $description=null)
 
 storeStableGauge ($key, $value, string $description=null)
 
 storeStableTimestamp ($key, \DateTimeImmutable $value, string $description=null)
 
 storeStableText ($key, string $value, string $description=null)
 
 storeVolatileBool ($key, bool $value, string $description=null)
 
 storeVolatileCounter ($key, int $value, string $description=null)
 
 storeVolatileGauge ($key, $value, string $description=null)
 
 storeVolatileTimestamp ($key, \DateTimeImmutable $value, string $description=null)
 
 storeVolatileText ($key, string $value, string $description=null)
 

Protected Member Functions

 doStore (array $base, array $path, $metric)
 Recursive implementation of storing. More...
 
 doAsMetric (array $cur)
 

Protected Attributes

 $metrics
 

Detailed Description

Definition at line 7 of file ArrayStorage.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Setup\Metrics\ArrayStorage::__construct ( )

Definition at line 16 of file ArrayStorage.php.

17 {
18 $this->metrics = [];
19 }

Member Function Documentation

◆ asMetric()

ILIAS\Setup\Metrics\ArrayStorage::asMetric ( )

Definition at line 50 of file ArrayStorage.php.

50 : Metric
51 {
52 return $this->doAsMetric($this->metrics);
53 }

References ILIAS\Setup\Metrics\ArrayStorage\doAsMetric().

+ Here is the call graph for this function:

◆ doAsMetric()

ILIAS\Setup\Metrics\ArrayStorage::doAsMetric ( array  $cur)
protected

Definition at line 55 of file ArrayStorage.php.

55 : Metric
56 {
57 return new Metric(
60 array_map(
61 function ($v) {
62 if (is_array($v)) {
63 return $this->doAsMetric($v);
64 }
65 return $v;
66 },
67 $cur
68 )
69 );
70 }

References ILIAS\Setup\Metrics\ArrayStorage\doAsMetric(), ILIAS\Setup\Metrics\Metric\STABILITY_MIXED, and ILIAS\Setup\Metrics\Metric\TYPE_COLLECTION.

Referenced by ILIAS\Setup\Metrics\ArrayStorage\asMetric(), and ILIAS\Setup\Metrics\ArrayStorage\doAsMetric().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doStore()

ILIAS\Setup\Metrics\ArrayStorage::doStore ( array  $base,
array  $path,
  $metric 
)
protected

Recursive implementation of storing.

Definition at line 33 of file ArrayStorage.php.

33 : array
34 {
35 $key = array_shift($path);
36 if (count($path) == 0) {
37 $base[$key] = $metric;
38 return $base;
39 }
40
41 $base[$key] = $this->doStore($base[$key] ?? [], $path, $metric);
42 return $base;
43 }
doStore(array $base, array $path, $metric)
Recursive implementation of storing.
$base
Definition: index.php:4

References $base, and ILIAS\Setup\Metrics\ArrayStorage\doStore().

Referenced by ILIAS\Setup\Metrics\ArrayStorage\doStore(), and ILIAS\Setup\Metrics\ArrayStorage\store().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get()

ILIAS\Setup\Metrics\ArrayStorage::get ( )

Definition at line 45 of file ArrayStorage.php.

45 : array
46 {
47 return $this->metrics;
48 }

References ILIAS\Setup\Metrics\ArrayStorage\$metrics.

◆ store()

ILIAS\Setup\Metrics\ArrayStorage::store ( string  $key,
Metric  $metric 
)

@inheritdocs

Implements ILIAS\Setup\Metrics\Storage.

Definition at line 24 of file ArrayStorage.php.

24 : void
25 {
26 $path = explode(".", $key);
27 $this->metrics = $this->doStore($this->metrics, $path, $metric);
28 }

References ILIAS\Setup\Metrics\ArrayStorage\doStore().

+ Here is the call graph for this function:

Field Documentation

◆ $metrics

ILIAS\Setup\Metrics\ArrayStorage::$metrics
protected

Definition at line 14 of file ArrayStorage.php.

Referenced by ILIAS\Setup\Metrics\ArrayStorage\get().


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