Commit 3eafb563 authored by Stan Hu's avatar Stan Hu

Fix Gitaly duration timings for ApplyBfgObjectMapStreamRequest

Previously the `gitaly_duration_s` log timings only accounted for the
initial request/response time. We now measure the total time it takes to
consume the streaming response for this RPC to complete.

Part of https://gitlab.com/gitlab-org/gitlab/-/issues/30334
parent d800c3d3
......@@ -13,15 +13,15 @@ module Gitlab
end
def apply_bfg_object_map_stream(io, &blk)
responses = GitalyClient.call(
GitalyClient.streaming_call(
storage,
:cleanup_service,
:apply_bfg_object_map_stream,
build_object_map_enum(io),
timeout: GitalyClient.long_timeout
)
responses.each(&blk)
) do |response|
response.each(&blk)
end
end
private
......
......@@ -22,5 +22,11 @@ describe Gitlab::GitalyClient::CleanupService do
client.apply_bfg_object_map_stream(StringIO.new)
end
it 'is wrapped as a streaming call' do
expect(Gitlab::GitalyClient).to receive(:streaming_call).with(anything, :cleanup_service, :apply_bfg_object_map_stream, anything, anything)
client.apply_bfg_object_map_stream(StringIO.new)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment