[#1307] object: Implement Patch
method
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
a4a1c3f18b
commit
e890f1b4b1
19 changed files with 430 additions and 81 deletions
|
@ -28,7 +28,7 @@ type (
|
|||
}
|
||||
|
||||
patchStreamMetric struct {
|
||||
stream PatchObjectstream
|
||||
stream PatchObjectStream
|
||||
metrics MetricRegister
|
||||
start time.Time
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ func (m MetricCollector) Put() (PutObjectStream, error) {
|
|||
return m.next.Put()
|
||||
}
|
||||
|
||||
func (m MetricCollector) Patch() (PatchObjectstream, error) {
|
||||
func (m MetricCollector) Patch() (PatchObjectStream, error) {
|
||||
if m.enabled {
|
||||
t := time.Now()
|
||||
|
||||
|
@ -214,7 +214,7 @@ func (s putStreamMetric) CloseAndRecv(ctx context.Context) (*object.PutResponse,
|
|||
return res, err
|
||||
}
|
||||
func (s patchStreamMetric) Send(ctx context.Context, req *object.PatchRequest) error {
|
||||
s.metrics.AddPayloadSize("Patch", len(req.GetBody().GetPatch().Chunk))
|
||||
s.metrics.AddPayloadSize("Patch", len(req.GetBody().GetPatch().GetChunk()))
|
||||
|
||||
return s.stream.Send(ctx, req)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue