-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathmock_invoke_metrics.go
More file actions
153 lines (119 loc) · 3.54 KB
/
mock_invoke_metrics.go
File metadata and controls
153 lines (119 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package interop
import (
json "encoding/json"
time "time"
mock "github.com/stretchr/testify/mock"
model "github.com/aws/aws-lambda-runtime-interface-emulator/internal/lambda-managed-instances/rapid/model"
)
type MockInvokeMetrics struct {
mock.Mock
}
func (_m *MockInvokeMetrics) AttachDependencies(_a0 InitStaticDataProvider, _a1 EventsAPI) {
_m.Called(_a0, _a1)
}
func (_m *MockInvokeMetrics) AttachInvokeRequest(_a0 InvokeRequest) {
_m.Called(_a0)
}
func (_m *MockInvokeMetrics) SendInvokeFinishedEvent(tracingCtx *TracingCtx, xrayErrorCause json.RawMessage) error {
ret := _m.Called(tracingCtx, xrayErrorCause)
if len(ret) == 0 {
panic("no return value specified for SendInvokeFinishedEvent")
}
var r0 error
if rf, ok := ret.Get(0).(func(*TracingCtx, json.RawMessage) error); ok {
r0 = rf(tracingCtx, xrayErrorCause)
} else {
r0 = ret.Error(0)
}
return r0
}
func (_m *MockInvokeMetrics) SendInvokeStartEvent(_a0 *TracingCtx) error {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for SendInvokeStartEvent")
}
var r0 error
if rf, ok := ret.Get(0).(func(*TracingCtx) error); ok {
r0 = rf(_a0)
} else {
r0 = ret.Error(0)
}
return r0
}
func (_m *MockInvokeMetrics) SendMetrics(_a0 model.AppError) error {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for SendMetrics")
}
var r0 error
if rf, ok := ret.Get(0).(func(model.AppError) error); ok {
r0 = rf(_a0)
} else {
r0 = ret.Error(0)
}
return r0
}
func (_m *MockInvokeMetrics) SetReservationUsed(wasReserved bool) {
_m.Called(wasReserved)
}
func (_m *MockInvokeMetrics) TriggerGetRequest() {
_m.Called()
}
func (_m *MockInvokeMetrics) TriggerGetResponse() {
_m.Called()
}
func (_m *MockInvokeMetrics) TriggerInvokeDone() (time.Duration, *time.Duration, InitStaticDataProvider) {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for TriggerInvokeDone")
}
var r0 time.Duration
var r1 *time.Duration
var r2 InitStaticDataProvider
if rf, ok := ret.Get(0).(func() (time.Duration, *time.Duration, InitStaticDataProvider)); ok {
return rf()
}
if rf, ok := ret.Get(0).(func() time.Duration); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(time.Duration)
}
if rf, ok := ret.Get(1).(func() *time.Duration); ok {
r1 = rf()
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*time.Duration)
}
}
if rf, ok := ret.Get(2).(func() InitStaticDataProvider); ok {
r2 = rf()
} else {
if ret.Get(2) != nil {
r2 = ret.Get(2).(InitStaticDataProvider)
}
}
return r0, r1, r2
}
func (_m *MockInvokeMetrics) TriggerSentRequest(bytes int64, requestPayloadReadDuration time.Duration, requestPayloadWriteDuration time.Duration) {
_m.Called(bytes, requestPayloadReadDuration, requestPayloadWriteDuration)
}
func (_m *MockInvokeMetrics) TriggerSentResponse(runtimeResponseSent bool, responseErr model.AppError, streamingMetrics *InvokeResponseMetrics, errorPayloadSizeBytes int) {
_m.Called(runtimeResponseSent, responseErr, streamingMetrics, errorPayloadSizeBytes)
}
func (_m *MockInvokeMetrics) TriggerStartRequest() {
_m.Called()
}
func (_m *MockInvokeMetrics) UpdateConcurrencyMetrics(inflightInvokes int, idleRuntimesCount int) {
_m.Called(inflightInvokes, idleRuntimesCount)
}
func NewMockInvokeMetrics(t interface {
mock.TestingT
Cleanup(func())
}) *MockInvokeMetrics {
mock := &MockInvokeMetrics{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}