Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead code #3627

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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