google-cloud-debugger 0.36.1 → 0.42.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +2 -1
- data/CHANGELOG.md +47 -0
- data/CONTRIBUTING.md +4 -4
- data/LOGGING.md +1 -1
- data/OVERVIEW.md +28 -59
- data/TROUBLESHOOTING.md +2 -8
- data/ext/google/cloud/debugger/debugger_c/tracer.c +8 -33
- data/lib/google-cloud-debugger.rb +14 -15
- data/lib/google/cloud/debugger.rb +18 -16
- data/lib/google/cloud/debugger/agent.rb +4 -1
- data/lib/google/cloud/debugger/breakpoint.rb +9 -9
- data/lib/google/cloud/debugger/breakpoint/evaluator.rb +19 -25
- data/lib/google/cloud/debugger/breakpoint/source_location.rb +6 -6
- data/lib/google/cloud/debugger/breakpoint/stack_frame.rb +5 -5
- data/lib/google/cloud/debugger/breakpoint/status_message.rb +4 -6
- data/lib/google/cloud/debugger/breakpoint/variable.rb +8 -11
- data/lib/google/cloud/debugger/breakpoint/variable_table.rb +1 -1
- data/lib/google/cloud/debugger/credentials.rb +9 -6
- data/lib/google/cloud/debugger/debuggee.rb +4 -4
- data/lib/google/cloud/debugger/middleware.rb +1 -1
- data/lib/google/cloud/debugger/rails.rb +2 -2
- data/lib/google/cloud/debugger/service.rb +28 -66
- data/lib/google/cloud/debugger/snappoint.rb +4 -7
- data/lib/google/cloud/debugger/transmitter.rb +1 -1
- data/lib/google/cloud/debugger/version.rb +1 -1
- metadata +14 -72
- data/lib/google/cloud/debugger/v2.rb +0 -243
- data/lib/google/cloud/debugger/v2/controller2_client.rb +0 -373
- data/lib/google/cloud/debugger/v2/controller2_client_config.json +0 -41
- data/lib/google/cloud/debugger/v2/credentials.rb +0 -42
- data/lib/google/cloud/debugger/v2/debugger2_client.rb +0 -481
- data/lib/google/cloud/debugger/v2/debugger2_client_config.json +0 -51
- data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/controller.rb +0 -91
- data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/data.rb +0 -443
- data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/debugger.rb +0 -151
- data/lib/google/cloud/debugger/v2/doc/google/devtools/source/v1/source_context.rb +0 -162
- data/lib/google/cloud/debugger/v2/doc/google/protobuf/empty.rb +0 -29
- data/lib/google/cloud/debugger/v2/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/devtools/clouddebugger/v2/controller_pb.rb +0 -50
- data/lib/google/devtools/clouddebugger/v2/controller_services_pb.rb +0 -98
- data/lib/google/devtools/clouddebugger/v2/data_pb.rb +0 -108
- data/lib/google/devtools/clouddebugger/v2/debugger_pb.rb +0 -77
- data/lib/google/devtools/clouddebugger/v2/debugger_services_pb.rb +0 -66
- data/lib/google/devtools/source/v1/source_context_pb.rb +0 -90
@@ -28,7 +28,7 @@ module Google
|
|
28
28
|
#
|
29
29
|
# Represent a debuggee application. Contains information that identifies
|
30
30
|
# debuggee applications from each other. Maps to gRPC struct
|
31
|
-
#
|
31
|
+
# Google::Cloud::Debugger::V2::Debuggee.
|
32
32
|
#
|
33
33
|
# It also automatically loads source context information generated from
|
34
34
|
# Cloud SDK. See [Stackdriver Debugger
|
@@ -111,10 +111,10 @@ module Google
|
|
111
111
|
|
112
112
|
##
|
113
113
|
# Convert this debuggee into a gRPC
|
114
|
-
# Google::
|
114
|
+
# Google::Cloud::Debugger::V2::Debuggee struct.
|
115
115
|
def to_grpc
|
116
116
|
source_context = source_context_from_json_file "source-context.json"
|
117
|
-
Google::
|
117
|
+
Google::Cloud::Debugger::V2::Debuggee.new(
|
118
118
|
id: id.to_s,
|
119
119
|
project: project_id_for_request_arg.to_s,
|
120
120
|
description: description.to_s,
|
@@ -179,7 +179,7 @@ module Google
|
|
179
179
|
# project ID if available (and if it matches the project set in the
|
180
180
|
# configuration). Otherwise, use the configured project.
|
181
181
|
def project_id_for_request_arg
|
182
|
-
if project_id == @env.
|
182
|
+
if project_id == @env.lookup_metadata("project", "project-id")
|
183
183
|
numeric_id = @env.numeric_project_id
|
184
184
|
return numeric_id.to_s if numeric_id
|
185
185
|
end
|
@@ -154,7 +154,7 @@ module Google
|
|
154
154
|
@debugger.agent.tracer.disable_traces_for_thread
|
155
155
|
|
156
156
|
# Reset quotas after each request finishes.
|
157
|
-
@debugger.agent.quota_manager
|
157
|
+
@debugger.agent.quota_manager&.reset
|
158
158
|
end
|
159
159
|
|
160
160
|
private
|
@@ -151,13 +151,13 @@ module Google
|
|
151
151
|
Debugger::Credentials.new credentials
|
152
152
|
end
|
153
153
|
rescue StandardError => e
|
154
|
-
|
154
|
+
$stdout.puts "Note: Google::Cloud::Debugger is disabled because " \
|
155
155
|
"it failed to authorize with the service. (#{e.message})"
|
156
156
|
return false
|
157
157
|
end
|
158
158
|
|
159
159
|
if project_id.to_s.empty?
|
160
|
-
|
160
|
+
$stdout.puts "Note: Google::Cloud::Debugger is disabled because " \
|
161
161
|
"the project ID could not be determined."
|
162
162
|
return false
|
163
163
|
end
|
@@ -16,7 +16,6 @@
|
|
16
16
|
require "google/cloud/errors"
|
17
17
|
require "google/cloud/debugger/version"
|
18
18
|
require "google/cloud/debugger/v2"
|
19
|
-
require "google/gax/errors"
|
20
19
|
require "uri"
|
21
20
|
|
22
21
|
module Google
|
@@ -26,103 +25,66 @@ module Google
|
|
26
25
|
# @private Represents the gRPC Debugger service, including all the API
|
27
26
|
# methods.
|
28
27
|
class Service
|
29
|
-
attr_accessor :project
|
28
|
+
attr_accessor :project
|
29
|
+
attr_accessor :credentials
|
30
|
+
attr_accessor :timeout
|
31
|
+
attr_accessor :host
|
30
32
|
|
31
33
|
##
|
32
34
|
# Creates a new Service instance.
|
33
|
-
def initialize project, credentials, timeout: nil,
|
34
|
-
host: nil
|
35
|
+
def initialize project, credentials, timeout: nil, host: nil
|
35
36
|
@project = project
|
36
37
|
@credentials = credentials
|
37
38
|
@timeout = timeout
|
38
|
-
@
|
39
|
-
@host = host || V2::Debugger2Client::SERVICE_ADDRESS
|
39
|
+
@host = host
|
40
40
|
end
|
41
41
|
|
42
42
|
def cloud_debugger
|
43
43
|
return mocked_debugger if mocked_debugger
|
44
44
|
@cloud_debugger ||=
|
45
|
-
V2::
|
46
|
-
credentials
|
47
|
-
timeout
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
)
|
45
|
+
V2::Controller::Client.new do |config|
|
46
|
+
config.credentials = credentials if credentials
|
47
|
+
config.timeout = timeout if timeout
|
48
|
+
config.endpoint = host if host
|
49
|
+
config.lib_name = "gccl"
|
50
|
+
config.lib_version = Google::Cloud::Debugger::VERSION
|
51
|
+
config.metadata = { "google-cloud-resource-prefix" => "projects/#{@project}" }
|
52
|
+
end
|
54
53
|
end
|
55
54
|
attr_accessor :mocked_debugger
|
56
55
|
|
57
56
|
def transmitter
|
58
57
|
return mocked_transmitter if mocked_transmitter
|
59
58
|
@transmitter ||=
|
60
|
-
V2::
|
61
|
-
credentials
|
62
|
-
timeout
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
)
|
59
|
+
V2::Controller::Client.new do |config|
|
60
|
+
config.credentials = credentials if credentials
|
61
|
+
config.timeout = timeout if timeout
|
62
|
+
config.endpoint = host if host
|
63
|
+
config.lib_name = "gccl"
|
64
|
+
config.lib_version = Google::Cloud::Debugger::VERSION
|
65
|
+
config.metadata = { "google-cloud-resource-prefix" => "projects/#{@project}" }
|
66
|
+
end
|
69
67
|
end
|
70
68
|
attr_accessor :mocked_transmitter
|
71
69
|
|
72
70
|
def register_debuggee debuggee_grpc
|
73
|
-
|
74
|
-
cloud_debugger.register_debuggee debuggee_grpc,
|
75
|
-
options: default_options
|
76
|
-
end
|
71
|
+
cloud_debugger.register_debuggee debuggee: debuggee_grpc
|
77
72
|
end
|
78
73
|
|
79
74
|
def list_active_breakpoints debuggee_id, wait_token
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
success_on_timeout: true,
|
84
|
-
options: default_options
|
85
|
-
end
|
75
|
+
cloud_debugger.list_active_breakpoints debuggee_id: debuggee_id.to_s,
|
76
|
+
wait_token: wait_token.to_s,
|
77
|
+
success_on_timeout: true
|
86
78
|
end
|
87
79
|
|
88
80
|
def update_active_breakpoint debuggee_id, breakpoint
|
89
|
-
|
90
|
-
|
91
|
-
breakpoint.to_grpc,
|
92
|
-
options: default_options
|
93
|
-
end
|
81
|
+
transmitter.update_active_breakpoint debuggee_id: debuggee_id.to_s,
|
82
|
+
breakpoint: breakpoint.to_grpc
|
94
83
|
end
|
95
84
|
|
96
85
|
def inspect
|
97
86
|
"#{self.class}(#{@project})"
|
98
87
|
end
|
99
|
-
|
100
|
-
protected
|
101
|
-
|
102
|
-
def service_address
|
103
|
-
return nil if host.nil?
|
104
|
-
URI.parse("//#{host}").host
|
105
|
-
end
|
106
|
-
|
107
|
-
def service_port
|
108
|
-
return nil if host.nil?
|
109
|
-
URI.parse("//#{host}").port
|
110
|
-
end
|
111
|
-
|
112
|
-
def default_headers
|
113
|
-
{ "google-cloud-resource-prefix" => "projects/#{@project}" }
|
114
|
-
end
|
115
|
-
|
116
|
-
def default_options
|
117
|
-
Google::Gax::CallOptions.new kwargs: default_headers
|
118
|
-
end
|
119
|
-
|
120
|
-
def execute
|
121
|
-
yield
|
122
|
-
rescue Google::Gax::GaxError => e
|
123
|
-
# GaxError wraps BadStatus, but exposes it as #cause
|
124
|
-
raise Google::Cloud::Error.from_error(e.cause)
|
125
|
-
end
|
126
88
|
end
|
127
89
|
end
|
128
90
|
end
|
@@ -33,11 +33,11 @@ module Google
|
|
33
33
|
|
34
34
|
##
|
35
35
|
# Max size of payload a Snappoint collects
|
36
|
-
MAX_PAYLOAD_SIZE =
|
36
|
+
MAX_PAYLOAD_SIZE = 32_768 # 32KB
|
37
37
|
|
38
38
|
##
|
39
39
|
# @private Max size an evaluated expression variable is allowed to be
|
40
|
-
MAX_EXPRESSION_LIMIT =
|
40
|
+
MAX_EXPRESSION_LIMIT = 32_768 # 32KB
|
41
41
|
|
42
42
|
##
|
43
43
|
# @private Max size a normal evaluated variable is allowed to be
|
@@ -56,8 +56,7 @@ module Google
|
|
56
56
|
# variable at index 0. This variable will be shared by other variable
|
57
57
|
# evaluations if this Snappoint exceeds size limit.
|
58
58
|
def init_var_table
|
59
|
-
return if @variable_table[0]
|
60
|
-
@variable_table[0].buffer_full_variable?
|
59
|
+
return if @variable_table[0]&.buffer_full_variable?
|
61
60
|
|
62
61
|
buffer_full_var = Variable.buffer_full_variable
|
63
62
|
@variable_table.variables.unshift buffer_full_var
|
@@ -179,11 +178,9 @@ module Google
|
|
179
178
|
end
|
180
179
|
end
|
181
180
|
|
182
|
-
|
181
|
+
variable_table.variables.inject result do |sum, var|
|
183
182
|
sum + var.payload_size
|
184
183
|
end
|
185
|
-
|
186
|
-
result
|
187
184
|
end
|
188
185
|
|
189
186
|
##
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-debugger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.42.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heng Xiong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: binding_of_caller
|
@@ -30,80 +30,40 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.5'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: google-cloud-
|
42
|
+
name: google-cloud-debugger-v2
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: google-
|
56
|
+
name: google-cloud-logging
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.8'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '1.8'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: googleapis-common-protos
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 1.3.9
|
76
|
-
- - "<"
|
77
60
|
- !ruby/object:Gem::Version
|
78
61
|
version: '2.0'
|
79
62
|
type: :runtime
|
80
63
|
prerelease: false
|
81
64
|
version_requirements: !ruby/object:Gem::Requirement
|
82
65
|
requirements:
|
83
|
-
- - "
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 1.3.9
|
86
|
-
- - "<"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '2.0'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: googleapis-common-protos-types
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - ">="
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: 1.0.4
|
96
|
-
- - "<"
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
version: '2.0'
|
99
|
-
type: :runtime
|
100
|
-
prerelease: false
|
101
|
-
version_requirements: !ruby/object:Gem::Requirement
|
102
|
-
requirements:
|
103
|
-
- - ">="
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
version: 1.0.4
|
106
|
-
- - "<"
|
66
|
+
- - "~>"
|
107
67
|
- !ruby/object:Gem::Version
|
108
68
|
version: '2.0'
|
109
69
|
- !ruby/object:Gem::Dependency
|
@@ -140,14 +100,14 @@ dependencies:
|
|
140
100
|
requirements:
|
141
101
|
- - "~>"
|
142
102
|
- !ruby/object:Gem::Version
|
143
|
-
version: 1.
|
103
|
+
version: 1.25.1
|
144
104
|
type: :development
|
145
105
|
prerelease: false
|
146
106
|
version_requirements: !ruby/object:Gem::Requirement
|
147
107
|
requirements:
|
148
108
|
- - "~>"
|
149
109
|
- !ruby/object:Gem::Version
|
150
|
-
version: 1.
|
110
|
+
version: 1.25.1
|
151
111
|
- !ruby/object:Gem::Dependency
|
152
112
|
name: minitest
|
153
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -366,25 +326,7 @@ files:
|
|
366
326
|
- lib/google/cloud/debugger/snappoint.rb
|
367
327
|
- lib/google/cloud/debugger/tracer.rb
|
368
328
|
- lib/google/cloud/debugger/transmitter.rb
|
369
|
-
- lib/google/cloud/debugger/v2.rb
|
370
|
-
- lib/google/cloud/debugger/v2/controller2_client.rb
|
371
|
-
- lib/google/cloud/debugger/v2/controller2_client_config.json
|
372
|
-
- lib/google/cloud/debugger/v2/credentials.rb
|
373
|
-
- lib/google/cloud/debugger/v2/debugger2_client.rb
|
374
|
-
- lib/google/cloud/debugger/v2/debugger2_client_config.json
|
375
|
-
- lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/controller.rb
|
376
|
-
- lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/data.rb
|
377
|
-
- lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/debugger.rb
|
378
|
-
- lib/google/cloud/debugger/v2/doc/google/devtools/source/v1/source_context.rb
|
379
|
-
- lib/google/cloud/debugger/v2/doc/google/protobuf/empty.rb
|
380
|
-
- lib/google/cloud/debugger/v2/doc/google/protobuf/timestamp.rb
|
381
329
|
- lib/google/cloud/debugger/version.rb
|
382
|
-
- lib/google/devtools/clouddebugger/v2/controller_pb.rb
|
383
|
-
- lib/google/devtools/clouddebugger/v2/controller_services_pb.rb
|
384
|
-
- lib/google/devtools/clouddebugger/v2/data_pb.rb
|
385
|
-
- lib/google/devtools/clouddebugger/v2/debugger_pb.rb
|
386
|
-
- lib/google/devtools/clouddebugger/v2/debugger_services_pb.rb
|
387
|
-
- lib/google/devtools/source/v1/source_context_pb.rb
|
388
330
|
homepage: https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-debugger
|
389
331
|
licenses:
|
390
332
|
- Apache-2.0
|
@@ -395,16 +337,16 @@ require_paths:
|
|
395
337
|
- lib
|
396
338
|
required_ruby_version: !ruby/object:Gem::Requirement
|
397
339
|
requirements:
|
398
|
-
- - "
|
340
|
+
- - "~>"
|
399
341
|
- !ruby/object:Gem::Version
|
400
|
-
version: '2.
|
342
|
+
version: '2.5'
|
401
343
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
402
344
|
requirements:
|
403
345
|
- - ">="
|
404
346
|
- !ruby/object:Gem::Version
|
405
347
|
version: '0'
|
406
348
|
requirements: []
|
407
|
-
rubygems_version: 3.
|
349
|
+
rubygems_version: 3.2.13
|
408
350
|
signing_key:
|
409
351
|
specification_version: 4
|
410
352
|
summary: API Client and instrumentation library for Stackdriver Debugger
|
@@ -1,243 +0,0 @@
|
|
1
|
-
# Copyright 2020 Google LLC
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
|
16
|
-
require "google/cloud/debugger/v2/debugger2_client"
|
17
|
-
require "google/cloud/debugger/v2/controller2_client"
|
18
|
-
|
19
|
-
module Google
|
20
|
-
module Cloud
|
21
|
-
module Debugger
|
22
|
-
# rubocop:disable LineLength
|
23
|
-
|
24
|
-
##
|
25
|
-
# # Ruby Client for Stackdriver Debugger API
|
26
|
-
#
|
27
|
-
# [Stackdriver Debugger API][Product Documentation]:
|
28
|
-
# Examines the call stack and variables of a running application without
|
29
|
-
# stopping or slowing it down.
|
30
|
-
# - [Product Documentation][]
|
31
|
-
#
|
32
|
-
# ## Quick Start
|
33
|
-
# In order to use this library, you first need to go through the following
|
34
|
-
# steps:
|
35
|
-
#
|
36
|
-
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
37
|
-
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
38
|
-
# 3. [Enable the Stackdriver Debugger API.](https://console.cloud.google.com/apis/library/clouddebugger.googleapis.com)
|
39
|
-
# 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-debugger/latest/file.AUTHENTICATION.html)
|
40
|
-
#
|
41
|
-
# ### Installation
|
42
|
-
# ```
|
43
|
-
# $ gem install google-cloud-debugger
|
44
|
-
# ```
|
45
|
-
#
|
46
|
-
# ### Next Steps
|
47
|
-
# - Read the [Stackdriver Debugger API Product documentation][Product Documentation]
|
48
|
-
# to learn more about the product and see How-to Guides.
|
49
|
-
# - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
|
50
|
-
# to see the full list of Cloud APIs that we cover.
|
51
|
-
#
|
52
|
-
# [Product Documentation]: https://cloud.google.com/debugger
|
53
|
-
#
|
54
|
-
# ## Enabling Logging
|
55
|
-
#
|
56
|
-
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
57
|
-
# The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
|
58
|
-
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
59
|
-
# that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
60
|
-
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
61
|
-
#
|
62
|
-
# Configuring a Ruby stdlib logger:
|
63
|
-
#
|
64
|
-
# ```ruby
|
65
|
-
# require "logger"
|
66
|
-
#
|
67
|
-
# module MyLogger
|
68
|
-
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
69
|
-
# def logger
|
70
|
-
# LOGGER
|
71
|
-
# end
|
72
|
-
# end
|
73
|
-
#
|
74
|
-
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
75
|
-
# module GRPC
|
76
|
-
# extend MyLogger
|
77
|
-
# end
|
78
|
-
# ```
|
79
|
-
#
|
80
|
-
module V2
|
81
|
-
# rubocop:enable LineLength
|
82
|
-
|
83
|
-
module Debugger2
|
84
|
-
##
|
85
|
-
# The Debugger service provides the API that allows users to collect run-time
|
86
|
-
# information from a running application, without stopping or slowing it down
|
87
|
-
# and without modifying its state. An application may include one or
|
88
|
-
# more replicated processes performing the same work.
|
89
|
-
#
|
90
|
-
# A debugged application is represented using the Debuggee concept. The
|
91
|
-
# Debugger service provides a way to query for available debuggees, but does
|
92
|
-
# not provide a way to create one. A debuggee is created using the Controller
|
93
|
-
# service, usually by running a debugger agent with the application.
|
94
|
-
#
|
95
|
-
# The Debugger service enables the client to set one or more Breakpoints on a
|
96
|
-
# Debuggee and collect the results of the set Breakpoints.
|
97
|
-
#
|
98
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
99
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
100
|
-
# be many types.
|
101
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
102
|
-
# authenticating requests made by this client.
|
103
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
104
|
-
# credentials for this client.
|
105
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
106
|
-
# credentials for this client.
|
107
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
108
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
109
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
110
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
111
|
-
# metadata for requests, generally, to give OAuth credentials.
|
112
|
-
# @param scopes [Array<String>]
|
113
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
114
|
-
# an updater_proc is supplied.
|
115
|
-
# @param client_config [Hash]
|
116
|
-
# A Hash for call options for each method. See
|
117
|
-
# Google::Gax#construct_settings for the structure of
|
118
|
-
# this data. Falls back to the default config if not specified
|
119
|
-
# or the specified config is missing data points.
|
120
|
-
# @param timeout [Numeric]
|
121
|
-
# The default timeout, in seconds, for calls made through this client.
|
122
|
-
# @param metadata [Hash]
|
123
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
124
|
-
# @param service_address [String]
|
125
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
126
|
-
# @param service_port [Integer]
|
127
|
-
# Override for the service port, or `nil` to leave as the default.
|
128
|
-
# @param exception_transformer [Proc]
|
129
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
130
|
-
# custom error handling.
|
131
|
-
def self.new \
|
132
|
-
credentials: nil,
|
133
|
-
scopes: nil,
|
134
|
-
client_config: nil,
|
135
|
-
timeout: nil,
|
136
|
-
metadata: nil,
|
137
|
-
service_address: nil,
|
138
|
-
service_port: nil,
|
139
|
-
exception_transformer: nil,
|
140
|
-
lib_name: nil,
|
141
|
-
lib_version: nil
|
142
|
-
kwargs = {
|
143
|
-
credentials: credentials,
|
144
|
-
scopes: scopes,
|
145
|
-
client_config: client_config,
|
146
|
-
timeout: timeout,
|
147
|
-
metadata: metadata,
|
148
|
-
exception_transformer: exception_transformer,
|
149
|
-
lib_name: lib_name,
|
150
|
-
service_address: service_address,
|
151
|
-
service_port: service_port,
|
152
|
-
lib_version: lib_version
|
153
|
-
}.select { |_, v| v != nil }
|
154
|
-
Google::Cloud::Debugger::V2::Debugger2Client.new(**kwargs)
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
module Controller2
|
159
|
-
##
|
160
|
-
# The Controller service provides the API for orchestrating a collection of
|
161
|
-
# debugger agents to perform debugging tasks. These agents are each attached
|
162
|
-
# to a process of an application which may include one or more replicas.
|
163
|
-
#
|
164
|
-
# The debugger agents register with the Controller to identify the application
|
165
|
-
# being debugged, the Debuggee. All agents that register with the same data,
|
166
|
-
# represent the same Debuggee, and are assigned the same `debuggee_id`.
|
167
|
-
#
|
168
|
-
# The debugger agents call the Controller to retrieve the list of active
|
169
|
-
# Breakpoints. Agents with the same `debuggee_id` get the same breakpoints
|
170
|
-
# list. An agent that can fulfill the breakpoint request updates the
|
171
|
-
# Controller with the breakpoint result. The controller selects the first
|
172
|
-
# result received and discards the rest of the results.
|
173
|
-
# Agents that poll again for active breakpoints will no longer have
|
174
|
-
# the completed breakpoint in the list and should remove that breakpoint from
|
175
|
-
# their attached process.
|
176
|
-
#
|
177
|
-
# The Controller service does not provide a way to retrieve the results of
|
178
|
-
# a completed breakpoint. This functionality is available using the Debugger
|
179
|
-
# service.
|
180
|
-
#
|
181
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
182
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
183
|
-
# be many types.
|
184
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
185
|
-
# authenticating requests made by this client.
|
186
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
187
|
-
# credentials for this client.
|
188
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
189
|
-
# credentials for this client.
|
190
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
191
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
192
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
193
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
194
|
-
# metadata for requests, generally, to give OAuth credentials.
|
195
|
-
# @param scopes [Array<String>]
|
196
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
197
|
-
# an updater_proc is supplied.
|
198
|
-
# @param client_config [Hash]
|
199
|
-
# A Hash for call options for each method. See
|
200
|
-
# Google::Gax#construct_settings for the structure of
|
201
|
-
# this data. Falls back to the default config if not specified
|
202
|
-
# or the specified config is missing data points.
|
203
|
-
# @param timeout [Numeric]
|
204
|
-
# The default timeout, in seconds, for calls made through this client.
|
205
|
-
# @param metadata [Hash]
|
206
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
207
|
-
# @param service_address [String]
|
208
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
209
|
-
# @param service_port [Integer]
|
210
|
-
# Override for the service port, or `nil` to leave as the default.
|
211
|
-
# @param exception_transformer [Proc]
|
212
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
213
|
-
# custom error handling.
|
214
|
-
def self.new \
|
215
|
-
credentials: nil,
|
216
|
-
scopes: nil,
|
217
|
-
client_config: nil,
|
218
|
-
timeout: nil,
|
219
|
-
metadata: nil,
|
220
|
-
service_address: nil,
|
221
|
-
service_port: nil,
|
222
|
-
exception_transformer: nil,
|
223
|
-
lib_name: nil,
|
224
|
-
lib_version: nil
|
225
|
-
kwargs = {
|
226
|
-
credentials: credentials,
|
227
|
-
scopes: scopes,
|
228
|
-
client_config: client_config,
|
229
|
-
timeout: timeout,
|
230
|
-
metadata: metadata,
|
231
|
-
exception_transformer: exception_transformer,
|
232
|
-
lib_name: lib_name,
|
233
|
-
service_address: service_address,
|
234
|
-
service_port: service_port,
|
235
|
-
lib_version: lib_version
|
236
|
-
}.select { |_, v| v != nil }
|
237
|
-
Google::Cloud::Debugger::V2::Controller2Client.new(**kwargs)
|
238
|
-
end
|
239
|
-
end
|
240
|
-
end
|
241
|
-
end
|
242
|
-
end
|
243
|
-
end
|