Skip to content

Commit

Permalink
src: add scriptId to stack@blocked_loop event
Browse files Browse the repository at this point in the history
PR-URL: #238
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
santigimeno committed Dec 18, 2024
1 parent a4dfbf6 commit fcf0865
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 25 deletions.
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

0 comments on commit fcf0865

Please sign in to comment.