@@ -315,13 +315,74 @@ src/newrelic/infinite_tracing/com_newrelic_trace_v1/v1.pb.go: protocol/infinite_
315
315
#
316
316
317
317
.PHONY : integration
318
- integration : Makefile daemon lasp-test-all
318
+ integration : Makefile daemon lasp-test-all integration-events-limits
319
319
for PHP in $$ {PHPS:-8.1 8.0 7.4 7.3 7.2 7.1 7.0 5.6 5.5}; do \
320
320
echo; echo "# PHP=$${PHP}"; \
321
321
env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) || exit 1; \
322
322
echo "# PHP=$${PHP}"; \
323
323
done
324
324
325
+ #
326
+ # Agent event limits integration testing
327
+ #
328
+ # Because of how the integration_runner connects to the collector (once before
329
+ # running any tests) we have to tell the runner the value the agent would
330
+ # have passed to it for each test. This means these tests are not testing
331
+ # the agent <-> daemon communcations of the agent's requested custom event limit
332
+ # via the daemon to the collector and daemon sending back the collectors harvest
333
+ # limit value.
334
+ #
335
+
336
+ .PHONY : integration-events-limits
337
+ integration-events-limits : daemon
338
+ # create array with the collector response for each agent requested custom events max samples
339
+ # currently based on fast harvest cycle being 5 seconds so ratio is 12:1
340
+ declare -A custom_limits_tests; \
341
+ custom_limits_tests[240]=20; \
342
+ custom_limits_tests[7000]=583; \
343
+ custom_limits_tests[30000]=2500; \
344
+ custom_limits_tests[100000]=8333; \
345
+ for PHP in $$ {PHPS:-8.1 8.0 7.4 7.3 7.2 7.1 7.0 5.6 5.5}; do \
346
+ echo; echo "# PHP=$${PHP}"; \
347
+ for custom_max in "$${!custom_limits_tests[@]}"; do \
348
+ collector_limit=$${custom_limits_tests[$$custom_max]}; \
349
+ php_test_file="tests/event_limits/custom/test_custom_events_max_samples_stored_$${custom_max}_limit.php"; \
350
+ env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) \
351
+ -max_custom_events $${custom_max} $${php_test_file} || exit 1; \
352
+ done; \
353
+ echo "# PHP=$${PHP}"; \
354
+ done;
355
+
356
+ # test for invalid value (-1) and (1000000)
357
+ # Should use default (30000) for -1 and max (100000) for 1000000
358
+ for PHP in $${PHPS:-8.1 8.0 7.4 7.3 7.2 7.1 7.0 5.6 5.5}; do \
359
+ env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) \
360
+ -max_custom_events 100000 \
361
+ tests/event_limits/custom/test_custom_events_max_samples_stored_invalid_toolarge_limit.php || exit 1; \
362
+ env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) \
363
+ -max_custom_events 30000 \
364
+ tests/event_limits/custom/test_custom_events_max_samples_stored_invalid_toosmall_limit.php || exit 1; \
365
+ echo "# PHP=$${PHP}"; \
366
+ done;
367
+
368
+ # also run a test where limit is set to 0
369
+ # default value is used
370
+ for PHP in $${PHPS:-8.1 8.0 7.4 7.3 7.2 7.1 7.0 5.6 5.5}; do \
371
+ env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) \
372
+ -max_custom_events 0 \
373
+ tests/event_limits/custom/test_custom_events_max_samples_stored_0_limit.php || exit 1; \
374
+ echo "# PHP=$${PHP}"; \
375
+ done;
376
+
377
+ # also run a test where no agent custom event limit is specified and verify
378
+ # default value is used
379
+ for PHP in $${PHPS:-8.1 8.0 7.4 7.3 7.2 7.1 7.0 5.6 5.5}; do \
380
+ env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) \
381
+ -max_custom_events 30000 \
382
+ tests/event_limits/custom/test_custom_events_max_samples_stored_not_specified.php || exit 1; \
383
+ echo "# PHP=$${PHP}"; \
384
+ done;
385
+
325
386
#
326
387
# Code profiling
327
388
#
0 commit comments