47 : array
48 {
53
60
61 $other_metric = new Metrics\Metric($volatile, $bool, true);
62
63 return [
64 "invalid_stability" => ["no_stability", $bool, true, "", false],
65 "invalid_type" => [$config, "no_type", true, "", false],
66
67 "bool" => [$config, $bool, true, "A boolean", true],
68 "counter" => [$stable,
$counter, 23,
"A counter",
true],
69 "gauge1" => [$volatile, $gauge, 42, "A gauge", true],
70 "gauge2" => [$volatile, $gauge, 13.37, "A gauge", true],
71 "timestamp" => [$config,
$timestamp, new \DateTimeImmutable(),
"A timestamp",
true],
72 "text" => [$stable, $text, "some text", "A text", true],
73 "collection" => [$volatile, $collection, ["other" => $other_metric], "A collection", true],
74
75 "no_bool1" => [$config, $bool, 1, "", false],
76 "no_bool2" => [$config, $bool, "foo", "", false],
77 "no_bool3" => [$config, $bool, new \DateTimeImmutable(), "", false],
78 "no_bool4" => [$config, $bool, [], "", false],
79
80 "no_counter1" => [$stable,
$counter,
false,
"",
false],
81 "no_counter2" => [$stable,
$counter, 3.1,
"",
false],
82 "no_counter3" => [$stable,
$counter,
"foo",
"",
false],
83 "no_counter4" => [$stable,
$counter, new \DateTimeImmutable(),
"",
false],
84 "no_counter5" => [$stable,
$counter, [],
"",
false],
85
86 "no_gauge1" => [$volatile, $gauge, true, "", false],
87 "no_gauge2" => [$volatile, $gauge, "foo", "", false],
88 "no_gauge3" => [$volatile, $gauge, new \DateTimeImmutable(), "", false],
89 "no_gauge4" => [$volatile, $gauge, [], "", false],
90
91 "no_timestamp1" => [$config,
$timestamp,
false,
"",
false],
92 "no_timestamp2" => [$config,
$timestamp, 1,
"",
false],
93 "no_timestamp3" => [$config,
$timestamp,
"foo",
"",
false],
94 "no_timestamp4" => [$config,
$timestamp, [],
"",
false],
95
96 "no_text1" => [$stable, $text, true, "", false],
97 "no_text2" => [$stable, $text, 1, "", false],
98 "no_text3" => [$stable, $text, new \DateTimeImmutable(), "", false],
99 "no_text4" => [$stable, $text, [], "", false],
100
101 "no_collection1" => [$volatile, $collection, false, "", false],
102 "no_collection2" => [$volatile, $collection, 1, "", false],
103 "no_collection3" => [$volatile, $collection, new \DateTimeImmutable(), "", false],
104 "no_collection4" => [$volatile, $collection, "foo", "", false],
105 "no_collection5" => [$volatile, $collection, ["a"], "", false],
106
107 "mixed_collection" => [$mixed, $collection, [], "", true],
108 "no_mixed_bool" => [$mixed, $bool, true, "", false],
109 "no_mixed_counter" => [$mixed,
$counter, 1,
"",
false],
110 "no_mixed_gauge" => [$mixed, $gauge, 1.0, "", false],
111 "no_mixed_timestamp" => [$mixed,
$timestamp, new \DateTimeImmutable(),
"",
false],
112 "no_mixed_text" => [$mixed, $text, "", "", false],
113 ];
114 }
foreach($mandatory_scripts as $file) $timestamp
const TYPE_BOOL
The type of the metric tells what to expect of the values.
const STABILITY_CONFIG
The stability of a metric tells how often we expect changes in the metric.