Skip to content

Commit 1a39571

Browse files
committed
Rename Process stats instance_id to instance_guid
1 parent f7d8d6c commit 1a39571

File tree

7 files changed

+20
-19
lines changed

7 files changed

+20
-19
lines changed

app/presenters/v3/process_stats_presenter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def found_instance_stats_hash(index, stats)
3434
{
3535
type: @type,
3636
index: index,
37-
instance_id: stats[:stats][:instance_id],
37+
instance_guid: stats[:stats][:instance_guid],
3838
state: stats[:state],
3939
routable: stats[:routable],
4040
host: stats[:stats][:host],

docs/v3/source/includes/api_resources/_processes.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
{
205205
"type": "web",
206206
"index": 0,
207-
"instance_id": "e49f448e-54d2-4c33-61a3-5335",
207+
"instance_guid": "e49f448e-54d2-4c33-61a3-5335",
208208
"state": "RUNNING",
209209
"usage": {
210210
"time": "2016-03-23T23:17:30.476314154Z",

docs/v3/source/includes/resources/processes/_stats_object.md.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Name | Type | Description
1313
---- | ---- | -----------
1414
**type** | _string_ | Process type; a unique identifier for processes belonging to an app
1515
**index** | _integer_ | The zero-based index of running instances
16-
**instance_id** | _string_ | The unique identifier of the instance
16+
**instance_guid** | _string_ | The unique identifier of the instance
1717
**state** | _string_ | The state of the instance; valid values are `RUNNING`, `CRASHED`, `STARTING`, `STOPPING`, `DOWN`
1818
**routable** | _boolean_ | Whether or not the instance is routable (determined by the readiness check of the app). If app readiness checks and routability are unsupported by Diego, this will return as `null`.
1919
**usage** | _object_ | Object containing actual usage data for the instance; the value is `{}` when usage data is unavailable

lib/cloud_controller/diego/reporters/instances_stats_reporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def build_info(state, actual_lrp, process, stats, quota_stats, log_cache_errors)
6868
name: process.name,
6969
uris: process.uris,
7070
host: actual_lrp.actual_lrp_net_info.address,
71-
instance_id: actual_lrp.actual_lrp_instance_key.instance_guid,
71+
instance_guid: actual_lrp.actual_lrp_instance_key.instance_guid,
7272
port: get_default_port(actual_lrp.actual_lrp_net_info),
7373
net_info: actual_lrp.actual_lrp_net_info.to_h,
7474
uptime: nanoseconds_to_seconds((Time.now.to_f * 1e9) - actual_lrp.since),

spec/request/processes_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@
528528
name: process.name,
529529
uris: process.uris,
530530
host: 'toast',
531-
instance_id: 'some-diego-instance-id',
531+
instance_guid: 'some-diego-instance-id',
532532
net_info: net_info_1,
533533
uptime: 12_345,
534534
mem_quota: process[:memory] * 1024 * 1024,
@@ -557,7 +557,7 @@
557557
'type' => 'worker',
558558
'index' => 0,
559559
'state' => 'RUNNING',
560-
'instance_id' => 'some-diego-instance-id',
560+
'instance_guid' => 'some-diego-instance-id',
561561
'routable' => true,
562562
'isolation_segment' => 'very-isolated',
563563
'details' => 'some-details',

spec/unit/lib/cloud_controller/diego/reporters/instances_stats_reporter_spec.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
8888
name: process.name,
8989
uris: process.uris,
9090
host: 'lrp-host',
91-
instance_id: 'instance-a',
91+
instance_guid: 'instance-a',
9292
port: 2222,
9393
net_info: lrp_1_net_info.to_h,
9494
uptime: two_days_in_seconds,
@@ -160,7 +160,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
160160
name: process.name,
161161
uris: process.uris,
162162
host: 'lrp-host',
163-
instance_id: 'instance-a',
163+
instance_guid: 'instance-a',
164164
port: 2222,
165165
net_info: lrp_1_net_info.to_h,
166166
uptime: two_days_in_seconds,
@@ -215,6 +215,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
215215
name: process.name,
216216
uris: process.uris,
217217
host: 'lrp-host',
218+
instance_guid: 'instance-a',
218219
port: 2222,
219220
net_info: lrp_1_net_info.to_h,
220221
uptime: two_days_in_seconds,
@@ -461,7 +462,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
461462
name: process.name,
462463
uris: process.uris,
463464
host: 'lrp-host',
464-
instance_id: 'instance-a',
465+
instance_guid: 'instance-a',
465466
port: 2222,
466467
net_info: lrp_1_net_info.to_h,
467468
uptime: two_days_in_seconds,
@@ -595,7 +596,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
595596
name: process.name,
596597
uris: process.uris,
597598
host: 'lrp-host',
598-
instance_id: 'instance-a',
599+
instance_guid: 'instance-a',
599600
port: 2222,
600601
net_info: lrp_1_net_info.to_h,
601602
uptime: two_days_in_seconds,

spec/unit/presenters/v3/process_stats_presenter_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module VCAP::CloudController::Presenters::V3
6565
name: process.name,
6666
uris: process.uris,
6767
host: 'myhost',
68-
instance_id: 'instance-a',
68+
instance_guid: 'instance-a',
6969
net_info: net_info_1,
7070
uptime: 12_345,
7171
mem_quota: process[:memory] * 1024 * 1024,
@@ -90,7 +90,7 @@ module VCAP::CloudController::Presenters::V3
9090
name: process.name,
9191
uris: process.uris,
9292
host: 'toast',
93-
instance_id: 'instance-b',
93+
instance_guid: 'instance-b',
9494
net_info: net_info_2,
9595
uptime: 42,
9696
mem_quota: process[:memory] * 1024 * 1024,
@@ -124,7 +124,7 @@ module VCAP::CloudController::Presenters::V3
124124
expect(result[0][:type]).to eq(process.type)
125125
expect(result[0][:index]).to eq(0)
126126
expect(result[0][:state]).to eq('RUNNING')
127-
expect(result[0][:instance_id]).to eq('instance-a')
127+
expect(result[0][:instance_guid]).to eq('instance-a')
128128
expect(result[0][:routable]).to be(true)
129129
expect(result[0][:details]).to be_nil
130130
expect(result[0][:isolation_segment]).to eq('hecka-compliant')
@@ -146,7 +146,7 @@ module VCAP::CloudController::Presenters::V3
146146
expect(result[1][:type]).to eq(process.type)
147147
expect(result[1][:index]).to eq(1)
148148
expect(result[1][:state]).to eq('CRASHED')
149-
expect(result[1][:instance_id]).to eq('instance-b')
149+
expect(result[1][:instance_guid]).to eq('instance-b')
150150
expect(result[1][:routable]).to be(false)
151151
expect(result[1][:details]).to eq('some-details')
152152
expect(result[1][:isolation_segment]).to be_nil
@@ -182,7 +182,7 @@ module VCAP::CloudController::Presenters::V3
182182
name: process.name,
183183
uris: process.uris,
184184
host: 'myhost',
185-
instance_id: 'instance-a',
185+
instance_guid: 'instance-a',
186186
net_info: net_info_1,
187187
uptime: 12_345,
188188
mem_quota: process[:memory] * 1024 * 1024,
@@ -222,7 +222,7 @@ module VCAP::CloudController::Presenters::V3
222222
name: process.name,
223223
uris: process.uris,
224224
host: 'myhost',
225-
instance_id: 'instance-a',
225+
instance_guid: 'instance-a',
226226
net_info: net_info_1,
227227
uptime: 12_345,
228228
mem_quota: process[:memory] * 1024 * 1024,
@@ -292,7 +292,7 @@ module VCAP::CloudController::Presenters::V3
292292
expect(result[0][:details]).to be_nil
293293
expect(result[0][:isolation_segment]).to eq('hecka-compliant')
294294
expect(result[0][:host]).to eq('myhost')
295-
expect(result[0][:instance_id]).to eq('instance-a')
295+
expect(result[0][:instance_guid]).to eq('instance-a')
296296
expect(result[0][:instance_internal_ip]).to eq('5.6.7.8')
297297
expect(result[0][:instance_ports]).to eq(instance_ports_1)
298298
expect(result[0][:uptime]).to eq(12_345)
@@ -319,7 +319,7 @@ module VCAP::CloudController::Presenters::V3
319319
name: process.name,
320320
uris: process.uris,
321321
host: 'myhost',
322-
instance_id: 'instance-a',
322+
instance_guid: 'instance-a',
323323
net_info: net_info_1,
324324
uptime: 12_345,
325325
fds_quota: process.file_descriptors,
@@ -338,7 +338,7 @@ module VCAP::CloudController::Presenters::V3
338338
expect(result[0][:details]).to be_nil
339339
expect(result[0][:isolation_segment]).to eq('hecka-compliant')
340340
expect(result[0][:host]).to eq('myhost')
341-
expect(result[0][:instance_id]).to eq('instance-a')
341+
expect(result[0][:instance_guid]).to eq('instance-a')
342342
expect(result[0][:instance_internal_ip]).to eq('5.6.7.8')
343343
expect(result[0][:instance_ports]).to eq(instance_ports_1)
344344
expect(result[0][:uptime]).to eq(12_345)

0 commit comments

Comments
 (0)