google-cloud-debugger 0.33.3 → 0.33.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 103303faa6ff1e2f4f9430dbccf2c29697a2dfae72f168b62d7c41cebd90d7fb
4
- data.tar.gz: 87c61393cd2f11c21bf07a0f714e68794556b962bd1ba49b361920815b9955fb
3
+ metadata.gz: 7955a6715c284e4a6b252821d10a171eddeffaa4b3a25aa52b3b2b2ad9908206
4
+ data.tar.gz: 325b388efb06877c49cecf2fa75dd72f5b64c0b4855b417b2268b111af82c29a
5
5
  SHA512:
6
- metadata.gz: 0402a9658bc51cce79d3a8b3d96bb44f27052ff53d9c6e93b970fcd230f98652325cb5ffe9cbcc58225328ddce886b7fa168326f7bfb5298bb3c443490da0984
7
- data.tar.gz: 75c271adff64edbcc9479ec461bc8b6c5174b2d463f31fd1b1c4e9436e8b6e0b590c300ce56fcd1416e0a0728ded29c47a24cb66d0b9af34a9e65c44cc4ac369
6
+ metadata.gz: c629a0e11f230080a491860ffd13a68489f2397b6c051a64b81fba092c91610c80f13e9f638c54cdd3932ca6240f31671a6fdc88e4d87661fc0d1dfe38dec694
7
+ data.tar.gz: 15b17570618bee28d9122a001f80056719bad4c8a5565f0e21e932fdf0d777edd920235ac2278f265543e69fec5aca429bb1643e2c6bd0a568b35f95999c60fb
@@ -2,20 +2,39 @@
2
2
 
3
3
  In general, the google-cloud-debugger library uses [Service
4
4
  Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
5
- credentials to connect to Google Cloud services. When running on Compute Engine
5
+ credentials to connect to Google Cloud services. When running within [Google
6
+ Cloud Platform environments](#google-cloud-platform-environments)
6
7
  the credentials will be discovered automatically. When running on other
7
8
  environments, the Service Account credentials can be specified by providing the
8
9
  path to the [JSON
9
10
  keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) for
10
- the account (or the JSON itself) in environment variables. Additionally, Cloud
11
- SDK credentials can also be discovered automatically, but this is only
12
- recommended during development.
11
+ the account (or the JSON itself) in [environment
12
+ variables](#environment-variables). Additionally, Cloud SDK credentials can also
13
+ be discovered automatically, but this is only recommended during development.
14
+
15
+ ## Quickstart
16
+
17
+ 1. [Create a service account and credentials](#creating-a-service-account).
18
+ 2. Set the [environment variable](#environment-variables).
19
+
20
+ ```sh
21
+ export DEBUGGER_CREDENTIALS=/path/to/json`
22
+ ```
23
+
24
+ 3. Initialize the client.
25
+
26
+ ```ruby
27
+ require "google/cloud/debugger"
28
+
29
+ client = Google::Cloud::Debugger.new
30
+ ```
13
31
 
14
32
  ## Project and Credential Lookup
15
33
 
16
- The google-cloud-debugger library aims to make authentication as simple as
17
- possible, and provides several mechanisms to configure your system without
18
- providing **Project ID** and **Service Account Credentials** directly in code.
34
+ The google-cloud-debugger library aims to make authentication
35
+ as simple as possible, and provides several mechanisms to configure your system
36
+ without providing **Project ID** and **Service Account Credentials** directly in
37
+ code.
19
38
 
20
39
  **Project ID** is discovered in the following order:
21
40
 
@@ -23,6 +42,7 @@ providing **Project ID** and **Service Account Credentials** directly in code.
23
42
  2. Specify project ID in configuration
24
43
  3. Discover project ID in environment variables
25
44
  4. Discover GCE project ID
45
+ 5. Discover project ID in credentials JSON
26
46
 
27
47
  **Credentials** are discovered in the following order:
28
48
 
@@ -73,12 +93,12 @@ environment variable, or the **Credentials JSON** itself can be stored for
73
93
  environments such as Docker containers where writing files is difficult or not
74
94
  encouraged.
75
95
 
76
- The environment variables that Debugger checks for project ID are:
96
+ The environment variables that google-cloud-debugger checks for project ID are:
77
97
 
78
98
  1. `DEBUGGER_PROJECT`
79
99
  2. `GOOGLE_CLOUD_PROJECT`
80
100
 
81
- The environment variables that Debugger checks for credentials are configured on {Google::Cloud::Debugger::V2::Credentials}:
101
+ The environment variables that google-cloud-debugger checks for credentials are configured on {Google::Cloud::Debugger::V2::Credentials}:
82
102
 
83
103
  1. `DEBUGGER_CREDENTIALS` - Path to JSON file, or JSON contents
84
104
  2. `DEBUGGER_KEYFILE` - Path to JSON file, or JSON contents
@@ -92,7 +112,7 @@ require "google/cloud/debugger"
92
112
  ENV["DEBUGGER_PROJECT"] = "my-project-id"
93
113
  ENV["DEBUGGER_CREDENTIALS"] = "path/to/keyfile.json"
94
114
 
95
- debugger = Google::Cloud::Debugger.new
115
+ client = Google::Cloud::Debugger.new
96
116
  ```
97
117
 
98
118
  ### Configuration
@@ -107,7 +127,7 @@ Google::Cloud::Debugger.configure do |config|
107
127
  config.credentials = "path/to/keyfile.json"
108
128
  end
109
129
 
110
- debugger = Google::Cloud::Debugger.new
130
+ client = Google::Cloud::Debugger.new
111
131
  ```
112
132
 
113
133
  ### Cloud SDK
@@ -140,7 +160,8 @@ Google Cloud requires a **Project ID** and **Service Account Credentials** to
140
160
  connect to the APIs. You will use the **Project ID** and **JSON key file** to
141
161
  connect to most services with google-cloud-debugger.
142
162
 
143
- If you are not running this client on Google Compute Engine, you need a Google
163
+ If you are not running this client within [Google Cloud Platform
164
+ environments](#google-cloud-platform-environments), you need a Google
144
165
  Developers service account.
145
166
 
146
167
  1. Visit the [Google Developers Console][dev-console].
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 0.33.4 / 2019-04-29
4
+
5
+ * Add AUTHENTICATION.md guide.
6
+ * Update documentation for common types.
7
+ * Extract gRPC header values from request.
8
+
3
9
  ### 0.33.3 / 2019-02-13
4
10
 
5
11
  * Fix bug (typo) in retrieving default on_error proc.
@@ -823,7 +823,7 @@ module Google
823
823
  #
824
824
  def readonly_eval_expression binding, expression
825
825
  compilation_result = validate_compiled_expression expression
826
- return compilation_result if compilation_result.is_a?(Exception)
826
+ return compilation_result if compilation_result.is_a? Exception
827
827
 
828
828
  readonly_eval_expression_exec binding, expression
829
829
  rescue StandardError => e
@@ -1080,7 +1080,7 @@ module Google
1080
1080
 
1081
1081
  def initialize msg = nil, mutation_cause = UNKNOWN_CAUSE
1082
1082
  @mutation_cause = mutation_cause
1083
- super(msg)
1083
+ super msg
1084
1084
  end
1085
1085
 
1086
1086
  def inspect
@@ -354,7 +354,7 @@ module Google
354
354
  # compound variables.
355
355
  def self.add_member_vars var, members, limit: nil
356
356
  members.each_with_index do |member, i|
357
- member_var = yield(member, i, limit)
357
+ member_var = yield member, i, limit
358
358
 
359
359
  limit = deduct_limit limit, member_var.total_size
360
360
 
@@ -491,7 +491,7 @@ module Google
491
491
  unless @total_size
492
492
  vars = [self, *(unique_members || [])]
493
493
 
494
- @total_size = vars.inject(payload_size) do |sum, var|
494
+ @total_size = vars.inject payload_size do |sum, var|
495
495
  if var.var_table && var.var_table_index
496
496
  sum + var.var_table[var.var_table_index].total_size
497
497
  else
@@ -515,7 +515,7 @@ module Google
515
515
  value.to_s.bytesize
516
516
 
517
517
  unless members.nil?
518
- @payload_size = members.inject(@payload_size) do |sum, member|
518
+ @payload_size = members.inject @payload_size do |sum, member|
519
519
  sum + member.payload_size
520
520
  end
521
521
  end
@@ -132,7 +132,7 @@ module Google
132
132
  !new_breakpoints.empty? ||
133
133
  (before_breakpoints_count != after_breakpoints_acount)
134
134
 
135
- on_breakpoints_change.call(@active_breakpoints) if
135
+ on_breakpoints_change.call @active_breakpoints if
136
136
  on_breakpoints_change.respond_to?(:call) && breakpoints_updated
137
137
  end
138
138
  end
@@ -123,7 +123,7 @@ module Google
123
123
  Google::Cloud::Debugger::RequestQuotaManager.new
124
124
  end
125
125
 
126
- Middleware.deferred_start(@debugger)
126
+ Middleware.deferred_start @debugger
127
127
  end
128
128
 
129
129
  ##
@@ -169,17 +169,17 @@ module Google
169
169
  # @private Compute the total size of all the evaluated variables in
170
170
  # this breakpoint.
171
171
  def calculate_total_size
172
- result = evaluated_expressions.inject(0) do |sum, exp|
172
+ result = evaluated_expressions.inject 0 do |sum, exp|
173
173
  sum + exp.payload_size
174
174
  end
175
175
 
176
176
  stack_frames.each do |stack_frame|
177
- result = stack_frame.locals.inject(result) do |sum, local|
177
+ result = stack_frame.locals.inject result do |sum, local|
178
178
  sum + local.payload_size
179
179
  end
180
180
  end
181
181
 
182
- result = variable_table.variables.inject(result) do |sum, var|
182
+ result = variable_table.variables.inject result do |sum, var|
183
183
  sum + var.payload_size
184
184
  end
185
185
 
@@ -34,7 +34,7 @@ module Google
34
34
  attr_reader :breakpoint
35
35
 
36
36
  def initialize message, breakpoint = nil
37
- super(message)
37
+ super message
38
38
  @breakpoint = breakpoint
39
39
  end
40
40
  end
@@ -93,7 +93,7 @@ module Google
93
93
  # @raise [TransmitterError] if there are no resources available to make
94
94
  # queue the API call on the thread pool.
95
95
  def submit breakpoint
96
- Concurrent::Promises.future_on(@thread_pool, breakpoint) do |bp|
96
+ Concurrent::Promises.future_on @thread_pool, breakpoint do |bp|
97
97
  submit_sync bp
98
98
  end
99
99
  rescue Concurrent::RejectedExecutionError => e
@@ -188,7 +188,10 @@ module Google
188
188
  @list_active_breakpoints = Google::Gax.create_api_call(
189
189
  @controller2_stub.method(:list_active_breakpoints),
190
190
  defaults["list_active_breakpoints"],
191
- exception_transformer: exception_transformer
191
+ exception_transformer: exception_transformer,
192
+ params_extractor: proc do |request|
193
+ {'debuggee_id' => request.debuggee_id}
194
+ end
192
195
  )
193
196
  @update_active_breakpoint = Google::Gax.create_api_call(
194
197
  @controller2_stub.method(:update_active_breakpoint),
@@ -175,7 +175,10 @@ module Google
175
175
  @set_breakpoint = Google::Gax.create_api_call(
176
176
  @debugger2_stub.method(:set_breakpoint),
177
177
  defaults["set_breakpoint"],
178
- exception_transformer: exception_transformer
178
+ exception_transformer: exception_transformer,
179
+ params_extractor: proc do |request|
180
+ {'debuggee_id' => request.debuggee_id}
181
+ end
179
182
  )
180
183
  @get_breakpoint = Google::Gax.create_api_call(
181
184
  @debugger2_stub.method(:get_breakpoint),
@@ -190,7 +193,10 @@ module Google
190
193
  @list_breakpoints = Google::Gax.create_api_call(
191
194
  @debugger2_stub.method(:list_breakpoints),
192
195
  defaults["list_breakpoints"],
193
- exception_transformer: exception_transformer
196
+ exception_transformer: exception_transformer,
197
+ params_extractor: proc do |request|
198
+ {'debuggee_id' => request.debuggee_id}
199
+ end
194
200
  )
195
201
  @list_debuggees = Google::Gax.create_api_call(
196
202
  @debugger2_stub.method(:list_debuggees),
@@ -15,17 +15,19 @@
15
15
 
16
16
  module Google
17
17
  module Protobuf
18
- # A Timestamp represents a point in time independent of any time zone
19
- # or calendar, represented as seconds and fractions of seconds at
20
- # nanosecond resolution in UTC Epoch time. It is encoded using the
21
- # Proleptic Gregorian Calendar which extends the Gregorian calendar
22
- # backwards to year one. It is encoded assuming all minutes are 60
23
- # seconds long, i.e. leap seconds are "smeared" so that no leap second
24
- # table is needed for interpretation. Range is from
25
- # 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
26
- # By restricting to that range, we ensure that we can convert to
27
- # and from RFC 3339 date strings.
28
- # See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
18
+ # A Timestamp represents a point in time independent of any time zone or local
19
+ # calendar, encoded as a count of seconds and fractions of seconds at
20
+ # nanosecond resolution. The count is relative to an epoch at UTC midnight on
21
+ # January 1, 1970, in the proleptic Gregorian calendar which extends the
22
+ # Gregorian calendar backwards to year one.
23
+ #
24
+ # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
25
+ # second table is needed for interpretation, using a [24-hour linear
26
+ # smear](https://developers.google.com/time/smear).
27
+ #
28
+ # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
29
+ # restricting to that range, we ensure that we can convert to and from [RFC
30
+ # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
29
31
  #
30
32
  # = Examples
31
33
  #
@@ -86,12 +88,12 @@ module Google
86
88
  # 01:30 UTC on January 15, 2017.
87
89
  #
88
90
  # In JavaScript, one can convert a Date object to this format using the
89
- # standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
91
+ # standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
90
92
  # method. In Python, a standard `datetime.datetime` object can be converted
91
93
  # to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
92
94
  # with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
93
95
  # can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
94
- # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--
96
+ # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
95
97
  # ) to obtain a formatter capable of generating timestamps in this format.
96
98
  # @!attribute [rw] seconds
97
99
  # @return [Integer]
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Debugger
19
- VERSION = "0.33.3".freeze
19
+ VERSION = "0.33.4".freeze
20
20
  end
21
21
  end
22
22
  end
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.33.3
4
+ version: 0.33.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heng Xiong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-13 00:00:00.000000000 Z
11
+ date: 2019-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.61.0
187
+ version: 0.64.0
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 0.61.0
194
+ version: 0.64.0
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: simplecov
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -364,8 +364,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
364
364
  - !ruby/object:Gem::Version
365
365
  version: '0'
366
366
  requirements: []
367
- rubyforge_project:
368
- rubygems_version: 2.7.6
367
+ rubygems_version: 3.0.3
369
368
  signing_key:
370
369
  specification_version: 4
371
370
  summary: API Client and instrumentation library for Stackdriver Debugger