Skip to content

Metrics V2 and Dynamic Config #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 179 commits into from
Jul 31, 2025
Merged

Metrics V2 and Dynamic Config #697

merged 179 commits into from
Jul 31, 2025

Conversation

DomPeliniAerospike
Copy link
Collaborator

@DomPeliniAerospike DomPeliniAerospike commented Jul 18, 2025

CLIENT-3407
CLIENT-3408

@DomPeliniAerospike DomPeliniAerospike changed the title Dev Metrics V2 and Dynamic Config Jul 18, 2025
Copy link

@AerospikeNate-L AerospikeNate-L left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably dont know enough about nodejs / ts to give this an exhaustive review, but a few little nits / confusion poinst stuck out

Otherwise if tests pass & examples work, looks good.

if (value->IsNumber()) {
if (defined != NULL)
(*defined) = true;
(*intp) = Nan::To<uint32_t>(value).FromJust();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assigns only the least significant byte of a 4-byte unsigned int to the uint8_t that intp points to..
should uint32_t be uint8_t here fore type-safety? maybe copy-paste from get_optional_uint32_property that didnt get refactored?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is standard practice for the Nodejs Client. The max number is 2^53 in nodejs. We don't size check for performance reasons, so this truncation practice is standard.

The conversion function get_optional_uint16_property uses Nan::To<uint32_t> to convert values as well.
Nan::To<uint32_t> is the smallest value available for this function, but since we are truncating anyways, we can still use the helper function and just truncate the value into a smaller value.

We also only use this value for small integers in non-database operations, so the result of a truncation should be relatively inconsequential.

Happy to talk more about this if you are still concerned.

/**
* There is a conflict between metrics enable/disable and dynamic configuration metrics.
*/
export const METRICS_CONFLICT = -19;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is AEROSPIKE_METRICS_CONFLICT -19 or -20?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will correct this to -20.

{
if (obj->IsUndefined() || obj->IsNull()) {
return AS_NODE_PARAM_ERR;
}
int rc = 0;
as_metrics_policy_init(policy);

bool defined = false;

int report_dir_size = 256;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the max path string length? do we have this documented somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

	/**
	 * Directory path to write metrics log files for listeners that write logs.
	 *
	 * Default: . (current directory)
	 */
	char report_dir[256];

C Client has it defined. I will document it in typings/index.d.ts.

@DomPeliniAerospike DomPeliniAerospike changed the base branch from stage to Nodejs-Release-6.3.0 July 31, 2025 06:46
@DomPeliniAerospike DomPeliniAerospike merged commit eb7e658 into Nodejs-Release-6.3.0 Jul 31, 2025
92 of 97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants