Skip to content

Commit 8297f6b

Browse files
test(profiling): scale IO operations and set 5% error margin in correctness tests
1 parent ace3d20 commit 8297f6b

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

profiling/tests/correctness/io_upscaling.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"scale_by_duration": false,
33
"test_name": "php_io_upscaling",
4-
"note": "PHP currently splits each 10 KiB fread into 8 KiB and 2 KiB reads; this test intentionally does not override that default. Two sampled 10 KiB writes upscale to 215211 bytes, while two sampled 8 KiB reads upscale to 213101 bytes.",
4+
"note": "40960 10 KiB operations produce 419430400 bytes (~4096 samples with 100 KiB interval).",
55
"stacks": [
66
{
77
"profile-type": "file-io-write-size",
88
"error-margin": 5,
9-
"value-matching-sum": 215211,
9+
"value-matching-sum": 419430400,
1010
"stack-content": [
1111
{
1212
"regular_expression": "<?php;main;write_operations;standard\\|fwrite$"
@@ -16,7 +16,7 @@
1616
{
1717
"profile-type": "file-io-read-size",
1818
"error-margin": 5,
19-
"value-matching-sum": 213101,
19+
"value-matching-sum": 419430400,
2020
"stack-content": [
2121
{
2222
"regular_expression": "<?php;main;read_operations;standard\\|fread$"

profiling/tests/correctness/io_upscaling.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Test file I/O upscaling with operations below the 100 KiB sampling interval.
33

44
const OPERATION_SIZE = 10 * 1024;
5-
const OPERATION_COUNT = 25;
5+
const OPERATION_COUNT = 40960;
66

77
function write_operations($handle, $data) {
88
for ($i = 0; $i < OPERATION_COUNT; $i++) {

profiling/tests/correctness/socket_io.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"scale_by_duration": false,
33
"test_name": "php_socket_io",
4-
"note": "4096 small and 8192 large 8 KiB operations produce 100663296 bytes (96 MiB).",
4+
"note": "16384 small and 32768 large 8 KiB operations produce 402653184 bytes (384 MiB).",
55
"stacks": [
66
{
77
"profile-type": "socket-write-size",
8-
"error-margin": 1,
9-
"value-matching-sum": 100663296,
8+
"error-margin": 5,
9+
"value-matching-sum": 402653184,
1010
"stack-content": [
1111
{
1212
"regular_expression": "<?php;main;small_socket_writes;standard\\|fwrite$",
@@ -22,8 +22,8 @@
2222
},
2323
{
2424
"profile-type": "socket-read-size",
25-
"error-margin": 1,
26-
"value-matching-sum": 100663296,
25+
"error-margin": 5,
26+
"value-matching-sum": 402653184,
2727
"stack-content": [
2828
{
2929
"regular_expression": "<?php;main;small_socket_writes;read_from_socket;standard\\|fread$",

profiling/tests/correctness/socket_io.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
// Test socket I/O profiling over a loopback connection on an ephemeral port.
33

4-
const OPERATION_COUNT = 4096;
4+
const OPERATION_COUNT = 16384;
55
const OPERATION_SIZE = 8 * 1024;
66

77
function read_from_socket($socket, $length) {

0 commit comments

Comments
 (0)