Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
philippthun committed Feb 6, 2024
1 parent e40056c commit c352e3f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def envelopes(desired_lrp, process)

[@logstats_client.container_metrics(
source_guid: source_guid,
auth_token: VCAP::CloudController::SecurityContext.auth_token,
logcache_filter: filter
), nil]
rescue GRPC::BadStatus, CloudController::Errors::ApiError => e
Expand Down
2 changes: 1 addition & 1 deletion lib/logcache/container_metric_batcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(logcache_client)
@logcache_client = logcache_client
end

def container_metrics(source_guid:, logcache_filter:, auth_token: nil)
def container_metrics(source_guid:, logcache_filter:)
now = Time.now
start_time = TimeUtils.to_nanoseconds(now - 2.minutes)
end_time = TimeUtils.to_nanoseconds(now)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
before do
allow(bbs_instances_client).to receive_messages(lrp_instances: bbs_actual_lrps_response, desired_lrp_instance: bbs_desired_lrp_response)
allow(log_cache_client).to receive(:container_metrics).
with(auth_token: 'my-token', source_guid: process.app.guid, logcache_filter: anything).
with(source_guid: process.app.guid, logcache_filter: anything).
and_return(log_cache_response)
allow(VCAP::CloudController::SecurityContext).to receive(:auth_token).and_return('my-token')
end

it 'returns a map of stats & states per index in the correct units' do
Expand Down Expand Up @@ -197,7 +196,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)
it 'gets metrics for the process and does not filter on the source_id' do
expect(log_cache_client).
to receive(:container_metrics).
with(auth_token: 'my-token', source_guid: process.guid, logcache_filter: anything).
with(source_guid: process.guid, logcache_filter: anything).
and_return(log_cache_response)

expect(instances_reporter.stats_for_app(process)).to eq([expected_stats_response, []])
Expand Down Expand Up @@ -385,7 +384,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)

before do
allow(log_cache_client).to receive(:container_metrics).
with(auth_token: 'my-token', source_guid: process.app.guid, logcache_filter: anything).
with(source_guid: process.app.guid, logcache_filter: anything).
and_raise(error)
allow(instances_reporter).to receive(:logger).and_return(mock_logger)
end
Expand Down Expand Up @@ -434,7 +433,7 @@ def make_actual_lrp(instance_guid:, index:, state:, error:, since:)

before do
allow(log_cache_client).to receive(:container_metrics).
with(auth_token: 'my-token', source_guid: process.app.guid, logcache_filter: anything).
with(source_guid: process.app.guid, logcache_filter: anything).
and_raise(error)
allow(instances_reporter).to receive(:logger).and_return(mock_logger)
end
Expand Down

0 comments on commit c352e3f

Please sign in to comment.