Skip to content

Commit

Permalink
Merge pull request #591 from newrelic/dev
Browse files Browse the repository at this point in the history
Release 10.4
  • Loading branch information
ZNeumann authored Dec 9, 2022
2 parents 4571e4f + ea45cc9 commit 30f9fca
Show file tree
Hide file tree
Showing 48 changed files with 2,153 additions and 89 deletions.
63 changes: 62 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,74 @@ src/newrelic/infinite_tracing/com_newrelic_trace_v1/v1.pb.go: protocol/infinite_
#

.PHONY: integration
integration: Makefile daemon lasp-test-all
integration: Makefile daemon lasp-test-all integration-events-limits
for PHP in $${PHPS:-8.1 8.0 7.4 7.3 7.2 7.1 7.0 5.6 5.5}; do \
echo; echo "# PHP=$${PHP}"; \
env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) || exit 1; \
echo "# PHP=$${PHP}"; \
done

#
# Agent event limits integration testing
#
# Because of how the integration_runner connects to the collector (once before
# running any tests) we have to tell the runner the value the agent would
# have passed to it for each test. This means these tests are not testing
# the agent <-> daemon communcations of the agent's requested custom event limit
# via the daemon to the collector and daemon sending back the collectors harvest
# limit value.
#

.PHONY: integration-events-limits
integration-events-limits: daemon
# create array with the collector response for each agent requested custom events max samples
# currently based on fast harvest cycle being 5 seconds so ratio is 12:1
declare -A custom_limits_tests; \
custom_limits_tests[240]=20; \
custom_limits_tests[7000]=583; \
custom_limits_tests[30000]=2500; \
custom_limits_tests[100000]=8333; \
for PHP in $${PHPS:-8.1 8.0 7.4 7.3 7.2 7.1 7.0 5.6 5.5}; do \
echo; echo "# PHP=$${PHP}"; \
for custom_max in "$${!custom_limits_tests[@]}"; do \
collector_limit=$${custom_limits_tests[$$custom_max]}; \
php_test_file="tests/event_limits/custom/test_custom_events_max_samples_stored_$${custom_max}_limit.php"; \
env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) \
-max_custom_events $${custom_max} $${php_test_file} || exit 1; \
done; \
echo "# PHP=$${PHP}"; \
done;

# test for invalid value (-1) and (1000000)
# Should use default (30000) for -1 and max (100000) for 1000000
for PHP in $${PHPS:-8.1 8.0 7.4 7.3 7.2 7.1 7.0 5.6 5.5}; do \
env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) \
-max_custom_events 100000 \
tests/event_limits/custom/test_custom_events_max_samples_stored_invalid_toolarge_limit.php || exit 1; \
env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) \
-max_custom_events 30000 \
tests/event_limits/custom/test_custom_events_max_samples_stored_invalid_toosmall_limit.php || exit 1; \
echo "# PHP=$${PHP}"; \
done;

# also run a test where limit is set to 0
# default value is used
for PHP in $${PHPS:-8.1 8.0 7.4 7.3 7.2 7.1 7.0 5.6 5.5}; do \
env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) \
-max_custom_events 0 \
tests/event_limits/custom/test_custom_events_max_samples_stored_0_limit.php || exit 1; \
echo "# PHP=$${PHP}"; \
done;

# also run a test where no agent custom event limit is specified and verify
# default value is used
for PHP in $${PHPS:-8.1 8.0 7.4 7.3 7.2 7.1 7.0 5.6 5.5}; do \
env NRLAMP_PHP=$${PHP} bin/integration_runner $(INTEGRATION_ARGS) \
-max_custom_events 30000 \
tests/event_limits/custom/test_custom_events_max_samples_stored_not_specified.php || exit 1; \
echo "# PHP=$${PHP}"; \
done;

#
# Code profiling
#
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.3.0
10.4.0
3 changes: 2 additions & 1 deletion agent/php_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
* Returns : A newly allocated JSON stack trace string or NULL on error.
*/
#define NR_PHP_STACKTRACE_LIMIT 300

extern char* nr_php_backtrace_to_json(zval* itrace TSRMLS_DC);

/*
Expand Down Expand Up @@ -802,7 +803,7 @@ extern zend_execute_data* nr_get_zend_execute_data(NR_EXECUTE_PROTO TSRMLS_DC);
*
*/
static inline uint32_t nr_php_zend_function_lineno(const zend_function* func) {
if (NULL != func) {
if (NULL != func && ZEND_USER_FUNCTION == func->op_array.type) {
return func->op_array.line_start;
}
return 0;
Expand Down
Loading

0 comments on commit 30f9fca

Please sign in to comment.