Class: Google::Cloud::Debugger::Debuggee
- Inherits:
-
Object
- Object
- Google::Cloud::Debugger::Debuggee
- Defined in:
- lib/google/cloud/debugger/debuggee.rb,
lib/google/cloud/debugger/debuggee/app_uniquifier_generator.rb
Overview
Debuggee
Represent a debuggee application. Contains information that identifies debuggee applications from each other. Maps to gRPC struct Devtools::Clouddebugger::V2::Debuggee.
It also automatically loads source context information generated from Cloud SDK. See Stackdriver Debugger doc for more information on how to generate this source context information when used on Google Container Engine and Google Compute engine. This step is taken care of if debuggee application is hosted on Google App Engine Flexibile.
To ensure the multiple instances of the application are indeed the same application, the debuggee also compute a "uniquifier" generated from source context or application source code.
Defined Under Namespace
Modules: AppUniquifierGenerator
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
Registered Debuggee ID.
-
#service_name ⇒ String
readonly
Name for the debuggee application.
-
#service_version ⇒ String
readonly
Version identifier for the debuggee application.
Instance Method Summary collapse
-
#register ⇒ Boolean
Register the current application as a debuggee with Stackdriver Debuggee service.
-
#registered? ⇒ Boolean
Check whether this debuggee is currently registered or not.
-
#revoke_registration ⇒ Object
Revoke the registration of this debuggee.
-
#to_grpc ⇒ Object
Convert this debuggee into a gRPC Google::Devtools::Clouddebugger::V2::Debuggee struct.
Instance Attribute Details
#id ⇒ String (readonly)
Registered Debuggee ID. Set by Stackdriver Debugger service when a debuggee application is sucessfully registered.
63 64 65 |
# File 'lib/google/cloud/debugger/debuggee.rb', line 63 def id @id end |
#service_name ⇒ String (readonly)
Name for the debuggee application
52 53 54 |
# File 'lib/google/cloud/debugger/debuggee.rb', line 52 def service_name @service_name end |
#service_version ⇒ String (readonly)
Version identifier for the debuggee application
57 58 59 |
# File 'lib/google/cloud/debugger/debuggee.rb', line 57 def service_version @service_version end |
Instance Method Details
#register ⇒ Boolean
Register the current application as a debuggee with Stackdriver Debuggee service.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/google/cloud/debugger/debuggee.rb', line 80 def register # Wait if backoff applies sleep @register_backoff.interval if @register_backoff.backing_off? begin response = service.register_debuggee to_grpc @id = response.debuggee.id rescue revoke_registration end registered = registered? registered ? @register_backoff.succeeded : @register_backoff.failed registered end |
#registered? ⇒ Boolean
Check whether this debuggee is currently registered or not
100 101 102 |
# File 'lib/google/cloud/debugger/debuggee.rb', line 100 def registered? !id.nil? end |
#revoke_registration ⇒ Object
Revoke the registration of this debuggee
106 107 108 |
# File 'lib/google/cloud/debugger/debuggee.rb', line 106 def revoke_registration @id = nil end |
#to_grpc ⇒ Object
Convert this debuggee into a gRPC Google::Devtools::Clouddebugger::V2::Debuggee struct.
113 114 115 116 117 118 |
# File 'lib/google/cloud/debugger/debuggee.rb', line 113 def to_grpc debuggee_args = build_request_arg Google::Devtools::Clouddebugger::V2::Debuggee.decode_json \ debuggee_args.to_json end |