Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit a245223

Browse files
maximgoldinemrekultursay
authored andcommitted
Adding streamz metrics to Java agent
Adding same counters as for C++ (in CL/149973373). For Java, we are running inside of web server. Making sure streamz is not part of GAE (b/36560056) Running the following tap_presubmit to cover apphosting testing: tap_presubmit -p cloud_debugger,apphosting,apphosting.java,apphosting.java7_piii,apphosting.java8,apphosting.prod_config,apphosting.prod_config.appengine,apphosting.sandman_flag_tests,apphosting.servinf -c 151850960 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=152066844
1 parent 1a40e7e commit a245223

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

src/agent/jvm_breakpoint.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "resolved_source_location.h"
3434
#include "statistician.h"
3535

36+
3637
DEFINE_FLAG(
3738
int32,
3839
breakpoint_expiration_sec,
@@ -784,7 +785,8 @@ void JvmBreakpoint::CompleteBreakpoint(
784785
BreakpointBuilder* builder,
785786
std::unique_ptr<CaptureDataCollector> collector) {
786787
builder->set_is_final_state(true);
787-
format_queue_->Enqueue(builder->build(), std::move(collector));
788+
std::unique_ptr<BreakpointModel> model = builder->build();
789+
format_queue_->Enqueue(std::move(model), std::move(collector));
788790

789791
breakpoints_manager_->CompleteBreakpoint(id());
790792

src/agent/model.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@ struct StatusMessageModel {
6262
(refers_to == other.refers_to) &&
6363
(description == other.description);
6464
}
65+
66+
string RefersToToString() const {
67+
switch (refers_to) {
68+
case Context::UNSPECIFIED : return "UNSPECIFIED";
69+
case Context::BREAKPOINT_SOURCE_LOCATION :
70+
return "BREAKPOINT_SOURCE_LOCATION";
71+
case Context::BREAKPOINT_CONDITION : return "BREAKPOINT_CONDITION";
72+
case Context::BREAKPOINT_EXPRESSION : return "BREAKPOINT_EXPRESSION";
73+
case Context::BREAKPOINT_AGE : return "BREAKPOINT_AGE";
74+
case Context::VARIABLE_NAME : return "VARIABLE_NAME";
75+
case Context::VARIABLE_VALUE : return "VARIABLE_VALUE";
76+
default : return "UNKNOWN";
77+
}
78+
}
6579
};
6680

6781
struct SourceLocationModel {
@@ -97,6 +111,14 @@ struct BreakpointModel {
97111
ERROR = 2
98112
};
99113

114+
string ActionToString() const {
115+
switch (action) {
116+
case Action::CAPTURE : return "CAPTURE";
117+
case Action::LOG : return "LOG";
118+
default : return "UNKNOWN";
119+
}
120+
}
121+
100122
string id;
101123
bool is_canary = false;
102124
Action action = Action::CAPTURE;

0 commit comments

Comments
 (0)