Skip to content
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

src: add scriptId to stack@blocked_loop event #238

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agents/grpc/proto/blocked_loop.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ message Stack {
string function_name = 3;
int32 line_number = 4;
int32 column = 5;
int32 script_id = 6;
}

message BlockedLoopBody {
Expand Down
1 change: 1 addition & 0 deletions agents/grpc/src/grpc_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ void PopulateBlockedLoopEvent(grpcagent::BlockedLoopEvent* blocked_loop_event,

proto_stack->set_line_number(stack["line_number"].get<int32_t>());
proto_stack->set_column(stack["column"].get<int32_t>());
proto_stack->set_script_id(stack["scriptId"].get<int32_t>());
}
}

Expand Down
76 changes: 51 additions & 25 deletions agents/grpc/src/proto/blocked_loop.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions agents/grpc/src/proto/blocked_loop.pb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/nsolid/nsolid_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ std::string EnvInst::GetOnBlockedBody() {
frame += std::to_string(stack_frame->GetLineNumber());
frame += ",\"column\":";
frame += std::to_string(stack_frame->GetColumn());
frame += ",\"scriptId\":";
frame += std::to_string(stack_frame->GetScriptId());

frame += "},";
body_string += frame;
Expand Down
1 change: 1 addition & 0 deletions test/agents/test-grpc-blocked-loop.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function checkBlockedLoopData(blocked, metadata, agentId, threadId) {

validateInteger(frame.lineNumber, 'lineNumber');
validateInteger(frame.column, 'column');
validateInteger(frame.scriptId, 'scriptId');
}

assert.strictEqual(blocked.body.threadId, `${threadId}`);
Expand Down
1 change: 1 addition & 0 deletions test/agents/test-zmq-blocked-loop.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function checkBlockedLoopData(blocked, agentId, threadId) {

validateInteger(frame.line_number, 'line_number');
validateInteger(frame.column, 'column');
validateInteger(frame.scriptId, 'scriptId');
}

assert.strictEqual(blocked.body.threadId, threadId);
Expand Down
Loading