-
Notifications
You must be signed in to change notification settings - Fork 79
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
Conversation
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
eb7e658
into
Nodejs-Release-6.3.0
CLIENT-3407
CLIENT-3408