ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 (string $key, bool $value, ?string $description=null)
 
 storeConfigCounter (string $key, int $value, ?string $description=null)
 
 storeConfigGauge (string $key, $value, ?string $description=null)
 
 storeConfigTimestamp (string $key, \DateTimeImmutable $value, ?string $description=null)
 
 storeConfigText (string $key, string $value, ?string $description=null)
 
 storeStableBool (string $key, bool $value, ?string $description=null)
 
 storeStableCounter (string $key, int $value, ?string $description=null)
 
 storeStableGauge (string $key, $value, ?string $description=null)
 
 storeStableTimestamp (string $key, \DateTimeImmutable $value, ?string $description=null)
 
 storeStableText (string $key, string $value, ?string $description=null)
 
 storeVolatileBool (string $key, bool $value, ?string $description=null)
 
 storeVolatileCounter (string $key, int $value, ?string $description=null)
 
 storeVolatileGauge (string $key, $value, ?string $description=null)
 
 storeVolatileTimestamp (string $key, \DateTimeImmutable $value, ?string $description=null)
 
 storeVolatileText (string $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

array $metrics
 

Detailed Description

Definition at line 23 of file ArrayStorage.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 32 of file ArrayStorage.php.

33 {
34 $this->metrics = [];
35 }

Member Function Documentation

◆ asMetric()

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

Definition at line 66 of file ArrayStorage.php.

66 : Metric
67 {
68 return $this->doAsMetric($this->metrics);
69 }

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 71 of file ArrayStorage.php.

71 : Metric
72 {
73 return new Metric(
76 array_map(
77 function ($v) {
78 if (is_array($v)) {
79 return $this->doAsMetric($v);
80 }
81 return $v;
82 },
83 $cur
84 )
85 );
86 }

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 49 of file ArrayStorage.php.

49 : array
50 {
51 $key = array_shift($path);
52 if (count($path) == 0) {
53 $base[$key] = $metric;
54 return $base;
55 }
56
57 $base[$key] = $this->doStore($base[$key] ?? [], $path, $metric);
58 return $base;
59 }
doStore(array $base, array $path, $metric)
Recursive implementation of storing.
$path
Definition: ltiservices.php:30

References $path, 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 61 of file ArrayStorage.php.

61 : array
62 {
63 return $this->metrics;
64 }

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 40 of file ArrayStorage.php.

40 : void
41 {
42 $path = explode(".", $key);
43 $this->metrics = $this->doStore($this->metrics, $path, $metric);
44 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $metrics

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

Definition at line 30 of file ArrayStorage.php.

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


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