Skip to content

Commit 18bfbff

Browse files
committed
Fix pipeline
1 parent 9d6ebc1 commit 18bfbff

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

config.w32

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ if (PHP_DDTRACE != 'no') {
6969
DDTRACE_TRACER_SOURCES += " tracer_otel_config.c";
7070
DDTRACE_TRACER_SOURCES += " profiling.c";
7171
DDTRACE_TRACER_SOURCES += " random.c";
72+
DDTRACE_TRACER_SOURCES += " routing_cache.c";
7273
DDTRACE_TRACER_SOURCES += " rule_matching.c";
7374
DDTRACE_TRACER_SOURCES += " serializer.c";
7475
DDTRACE_TRACER_SOURCES += " span.c";

src/bridge/_files_tracer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@
4141
__DIR__ . '/../DDTrace/Propagators/TextMap.php',
4242
__DIR__ . '/../DDTrace/ScopeManager.php',
4343
__DIR__ . '/../DDTrace/Tracer.php',
44+
__DIR__ . '/../DDTrace/Util/RouteNormalizer.php',
4445
];
Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
11
--TEST--
2-
DDTrace\routing_cache evicts least-recently-used entry when capacity (500) is exceeded
2+
DDTrace\routing_cache evicts the oldest inserted entry when capacity (500) is exceeded
33
--FILE--
44
<?php
55

6-
// Fill the cache to capacity (500 entries)
6+
// Fill the cache to capacity (500 entries); key0 is the oldest inserted
77
for ($i = 0; $i < 500; $i++) {
88
DDTrace\routing_cache_set("key$i", "value$i");
99
}
1010

11-
// key0 is the LRU — access key1..key499 to keep them hot, leaving key0 as LRU
12-
// Actually they were inserted oldest-first, so key0 is at tail (LRU).
13-
// Verify key0 is still present before eviction
11+
// key0 is present before any eviction
1412
var_dump(DDTrace\routing_cache_get('key0'));
1513

16-
// Access key0 to move it to MRU position so key1 becomes LRU
17-
DDTrace\routing_cache_get('key0');
18-
19-
// Insert one more entry; key1 should be evicted (it's now LRU)
14+
// Insert one more entry; key0 (oldest) should be evicted
2015
DDTrace\routing_cache_set('key500', 'value500');
2116

22-
var_dump(DDTrace\routing_cache_get('key1')); // evicted
23-
var_dump(DDTrace\routing_cache_get('key0')); // still present (was accessed)
17+
var_dump(DDTrace\routing_cache_get('key0')); // evicted
18+
var_dump(DDTrace\routing_cache_get('key1')); // still present
2419
var_dump(DDTrace\routing_cache_get('key500')); // newly inserted
2520

2621
?>
2722
--EXPECT--
2823
string(6) "value0"
2924
bool(false)
30-
string(6) "value0"
25+
string(6) "value1"
3126
string(8) "value500"

0 commit comments

Comments
 (0)