-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNone.php
More file actions
63 lines (55 loc) · 1.75 KB
/
None.php
File metadata and controls
63 lines (55 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
namespace Utopia\Telemetry\Adapter;
use Utopia\Telemetry\Adapter;
use Utopia\Telemetry\Counter;
use Utopia\Telemetry\Gauge;
use Utopia\Telemetry\Histogram;
use Utopia\Telemetry\Span;
use Utopia\Telemetry\UpDownCounter;
class None implements Adapter
{
public function createCounter(string $name, ?string $unit = null, ?string $description = null, array $advisory = []): Counter
{
return new class () extends Counter {
public function add(float|int $amount, iterable $attributes = []): void
{
}
};
}
public function createHistogram(string $name, ?string $unit = null, ?string $description = null, array $advisory = []): Histogram
{
return new class () extends Histogram {
public function record(float|int $amount, iterable $attributes = []): void
{
}
};
}
public function createGauge(string $name, ?string $unit = null, ?string $description = null, array $advisory = []): Gauge
{
return new class () extends Gauge {
public function record(float|int $amount, iterable $attributes = []): void
{
}
};
}
public function createUpDownCounter(string $name, ?string $unit = null, ?string $description = null, array $advisory = []): UpDownCounter
{
return new class () extends UpDownCounter {
public function add(float|int $amount, iterable $attributes = []): void
{
}
};
}
public function createSpan(string $name): Span
{
return new class () extends Span {
public function end(): void
{
}
};
}
public function collect(): bool
{
return true;
}
}