25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

794 lines
29 KiB

  1. // Code generated by protoc-gen-go.
  2. // source: loadtest.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package google_pubsub_loadtest is a generated protocol buffer package.
  6. It is generated from these files:
  7. loadtest.proto
  8. It has these top-level messages:
  9. StartRequest
  10. StartResponse
  11. PubsubOptions
  12. KafkaOptions
  13. MessageIdentifier
  14. CheckRequest
  15. CheckResponse
  16. ExecuteRequest
  17. ExecuteResponse
  18. */
  19. package google_pubsub_loadtest
  20. import proto "github.com/golang/protobuf/proto"
  21. import fmt "fmt"
  22. import math "math"
  23. import google_protobuf "github.com/golang/protobuf/ptypes/duration"
  24. import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp"
  25. import (
  26. "context"
  27. grpc "google.golang.org/grpc"
  28. )
  29. // Reference imports to suppress errors if they are not otherwise used.
  30. var _ = proto.Marshal
  31. var _ = fmt.Errorf
  32. var _ = math.Inf
  33. // This is a compile-time assertion to ensure that this generated file
  34. // is compatible with the proto package it is being compiled against.
  35. // A compilation error at this line likely means your copy of the
  36. // proto package needs to be updated.
  37. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  38. type StartRequest struct {
  39. // The GCP project. This must be set even for Kafka, as we use it to export metrics.
  40. Project string `protobuf:"bytes,1,opt,name=project" json:"project,omitempty"`
  41. // The Pub/Sub or Kafka topic name.
  42. Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"`
  43. // The number of requests that can be made, each second, per client.
  44. RequestRate int32 `protobuf:"varint,3,opt,name=request_rate,json=requestRate" json:"request_rate,omitempty"`
  45. // The size of each user message to publish
  46. MessageSize int32 `protobuf:"varint,4,opt,name=message_size,json=messageSize" json:"message_size,omitempty"`
  47. // The maximum outstanding requests, per client.
  48. MaxOutstandingRequests int32 `protobuf:"varint,5,opt,name=max_outstanding_requests,json=maxOutstandingRequests" json:"max_outstanding_requests,omitempty"`
  49. // The time at which the load test should start. If this is less than the current time, we start immediately.
  50. StartTime *google_protobuf1.Timestamp `protobuf:"bytes,6,opt,name=start_time,json=startTime" json:"start_time,omitempty"`
  51. // The burn-in duration, before which results should not be reported.
  52. BurnInDuration *google_protobuf.Duration `protobuf:"bytes,12,opt,name=burn_in_duration,json=burnInDuration" json:"burn_in_duration,omitempty"`
  53. // The number of user messages of size message_size to publish together.
  54. PublishBatchSize int32 `protobuf:"varint,11,opt,name=publish_batch_size,json=publishBatchSize" json:"publish_batch_size,omitempty"`
  55. // The max duration for coalescing a batch of published messages.
  56. PublishBatchDuration *google_protobuf.Duration `protobuf:"bytes,13,opt,name=publish_batch_duration,json=publishBatchDuration" json:"publish_batch_duration,omitempty"`
  57. // Types that are valid to be assigned to StopConditions:
  58. // *StartRequest_TestDuration
  59. // *StartRequest_NumberOfMessages
  60. StopConditions isStartRequest_StopConditions `protobuf_oneof:"stop_conditions"`
  61. // Types that are valid to be assigned to Options:
  62. // *StartRequest_PubsubOptions
  63. // *StartRequest_KafkaOptions
  64. Options isStartRequest_Options `protobuf_oneof:"options"`
  65. }
  66. func (m *StartRequest) Reset() { *m = StartRequest{} }
  67. func (m *StartRequest) String() string { return proto.CompactTextString(m) }
  68. func (*StartRequest) ProtoMessage() {}
  69. func (*StartRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  70. type isStartRequest_StopConditions interface {
  71. isStartRequest_StopConditions()
  72. }
  73. type isStartRequest_Options interface {
  74. isStartRequest_Options()
  75. }
  76. type StartRequest_TestDuration struct {
  77. TestDuration *google_protobuf.Duration `protobuf:"bytes,7,opt,name=test_duration,json=testDuration,oneof"`
  78. }
  79. type StartRequest_NumberOfMessages struct {
  80. NumberOfMessages int32 `protobuf:"varint,8,opt,name=number_of_messages,json=numberOfMessages,oneof"`
  81. }
  82. type StartRequest_PubsubOptions struct {
  83. PubsubOptions *PubsubOptions `protobuf:"bytes,9,opt,name=pubsub_options,json=pubsubOptions,oneof"`
  84. }
  85. type StartRequest_KafkaOptions struct {
  86. KafkaOptions *KafkaOptions `protobuf:"bytes,10,opt,name=kafka_options,json=kafkaOptions,oneof"`
  87. }
  88. func (*StartRequest_TestDuration) isStartRequest_StopConditions() {}
  89. func (*StartRequest_NumberOfMessages) isStartRequest_StopConditions() {}
  90. func (*StartRequest_PubsubOptions) isStartRequest_Options() {}
  91. func (*StartRequest_KafkaOptions) isStartRequest_Options() {}
  92. func (m *StartRequest) GetStopConditions() isStartRequest_StopConditions {
  93. if m != nil {
  94. return m.StopConditions
  95. }
  96. return nil
  97. }
  98. func (m *StartRequest) GetOptions() isStartRequest_Options {
  99. if m != nil {
  100. return m.Options
  101. }
  102. return nil
  103. }
  104. func (m *StartRequest) GetProject() string {
  105. if m != nil {
  106. return m.Project
  107. }
  108. return ""
  109. }
  110. func (m *StartRequest) GetTopic() string {
  111. if m != nil {
  112. return m.Topic
  113. }
  114. return ""
  115. }
  116. func (m *StartRequest) GetRequestRate() int32 {
  117. if m != nil {
  118. return m.RequestRate
  119. }
  120. return 0
  121. }
  122. func (m *StartRequest) GetMessageSize() int32 {
  123. if m != nil {
  124. return m.MessageSize
  125. }
  126. return 0
  127. }
  128. func (m *StartRequest) GetMaxOutstandingRequests() int32 {
  129. if m != nil {
  130. return m.MaxOutstandingRequests
  131. }
  132. return 0
  133. }
  134. func (m *StartRequest) GetStartTime() *google_protobuf1.Timestamp {
  135. if m != nil {
  136. return m.StartTime
  137. }
  138. return nil
  139. }
  140. func (m *StartRequest) GetBurnInDuration() *google_protobuf.Duration {
  141. if m != nil {
  142. return m.BurnInDuration
  143. }
  144. return nil
  145. }
  146. func (m *StartRequest) GetPublishBatchSize() int32 {
  147. if m != nil {
  148. return m.PublishBatchSize
  149. }
  150. return 0
  151. }
  152. func (m *StartRequest) GetPublishBatchDuration() *google_protobuf.Duration {
  153. if m != nil {
  154. return m.PublishBatchDuration
  155. }
  156. return nil
  157. }
  158. func (m *StartRequest) GetTestDuration() *google_protobuf.Duration {
  159. if x, ok := m.GetStopConditions().(*StartRequest_TestDuration); ok {
  160. return x.TestDuration
  161. }
  162. return nil
  163. }
  164. func (m *StartRequest) GetNumberOfMessages() int32 {
  165. if x, ok := m.GetStopConditions().(*StartRequest_NumberOfMessages); ok {
  166. return x.NumberOfMessages
  167. }
  168. return 0
  169. }
  170. func (m *StartRequest) GetPubsubOptions() *PubsubOptions {
  171. if x, ok := m.GetOptions().(*StartRequest_PubsubOptions); ok {
  172. return x.PubsubOptions
  173. }
  174. return nil
  175. }
  176. func (m *StartRequest) GetKafkaOptions() *KafkaOptions {
  177. if x, ok := m.GetOptions().(*StartRequest_KafkaOptions); ok {
  178. return x.KafkaOptions
  179. }
  180. return nil
  181. }
  182. // XXX_OneofFuncs is for the internal use of the proto package.
  183. func (*StartRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  184. return _StartRequest_OneofMarshaler, _StartRequest_OneofUnmarshaler, _StartRequest_OneofSizer, []interface{}{
  185. (*StartRequest_TestDuration)(nil),
  186. (*StartRequest_NumberOfMessages)(nil),
  187. (*StartRequest_PubsubOptions)(nil),
  188. (*StartRequest_KafkaOptions)(nil),
  189. }
  190. }
  191. func _StartRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  192. m := msg.(*StartRequest)
  193. // stop_conditions
  194. switch x := m.StopConditions.(type) {
  195. case *StartRequest_TestDuration:
  196. b.EncodeVarint(7<<3 | proto.WireBytes)
  197. if err := b.EncodeMessage(x.TestDuration); err != nil {
  198. return err
  199. }
  200. case *StartRequest_NumberOfMessages:
  201. b.EncodeVarint(8<<3 | proto.WireVarint)
  202. b.EncodeVarint(uint64(x.NumberOfMessages))
  203. case nil:
  204. default:
  205. return fmt.Errorf("StartRequest.StopConditions has unexpected type %T", x)
  206. }
  207. // options
  208. switch x := m.Options.(type) {
  209. case *StartRequest_PubsubOptions:
  210. b.EncodeVarint(9<<3 | proto.WireBytes)
  211. if err := b.EncodeMessage(x.PubsubOptions); err != nil {
  212. return err
  213. }
  214. case *StartRequest_KafkaOptions:
  215. b.EncodeVarint(10<<3 | proto.WireBytes)
  216. if err := b.EncodeMessage(x.KafkaOptions); err != nil {
  217. return err
  218. }
  219. case nil:
  220. default:
  221. return fmt.Errorf("StartRequest.Options has unexpected type %T", x)
  222. }
  223. return nil
  224. }
  225. func _StartRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  226. m := msg.(*StartRequest)
  227. switch tag {
  228. case 7: // stop_conditions.test_duration
  229. if wire != proto.WireBytes {
  230. return true, proto.ErrInternalBadWireType
  231. }
  232. msg := new(google_protobuf.Duration)
  233. err := b.DecodeMessage(msg)
  234. m.StopConditions = &StartRequest_TestDuration{msg}
  235. return true, err
  236. case 8: // stop_conditions.number_of_messages
  237. if wire != proto.WireVarint {
  238. return true, proto.ErrInternalBadWireType
  239. }
  240. x, err := b.DecodeVarint()
  241. m.StopConditions = &StartRequest_NumberOfMessages{int32(x)}
  242. return true, err
  243. case 9: // options.pubsub_options
  244. if wire != proto.WireBytes {
  245. return true, proto.ErrInternalBadWireType
  246. }
  247. msg := new(PubsubOptions)
  248. err := b.DecodeMessage(msg)
  249. m.Options = &StartRequest_PubsubOptions{msg}
  250. return true, err
  251. case 10: // options.kafka_options
  252. if wire != proto.WireBytes {
  253. return true, proto.ErrInternalBadWireType
  254. }
  255. msg := new(KafkaOptions)
  256. err := b.DecodeMessage(msg)
  257. m.Options = &StartRequest_KafkaOptions{msg}
  258. return true, err
  259. default:
  260. return false, nil
  261. }
  262. }
  263. func _StartRequest_OneofSizer(msg proto.Message) (n int) {
  264. m := msg.(*StartRequest)
  265. // stop_conditions
  266. switch x := m.StopConditions.(type) {
  267. case *StartRequest_TestDuration:
  268. s := proto.Size(x.TestDuration)
  269. n += proto.SizeVarint(7<<3 | proto.WireBytes)
  270. n += proto.SizeVarint(uint64(s))
  271. n += s
  272. case *StartRequest_NumberOfMessages:
  273. n += proto.SizeVarint(8<<3 | proto.WireVarint)
  274. n += proto.SizeVarint(uint64(x.NumberOfMessages))
  275. case nil:
  276. default:
  277. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  278. }
  279. // options
  280. switch x := m.Options.(type) {
  281. case *StartRequest_PubsubOptions:
  282. s := proto.Size(x.PubsubOptions)
  283. n += proto.SizeVarint(9<<3 | proto.WireBytes)
  284. n += proto.SizeVarint(uint64(s))
  285. n += s
  286. case *StartRequest_KafkaOptions:
  287. s := proto.Size(x.KafkaOptions)
  288. n += proto.SizeVarint(10<<3 | proto.WireBytes)
  289. n += proto.SizeVarint(uint64(s))
  290. n += s
  291. case nil:
  292. default:
  293. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  294. }
  295. return n
  296. }
  297. type StartResponse struct {
  298. }
  299. func (m *StartResponse) Reset() { *m = StartResponse{} }
  300. func (m *StartResponse) String() string { return proto.CompactTextString(m) }
  301. func (*StartResponse) ProtoMessage() {}
  302. func (*StartResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
  303. type PubsubOptions struct {
  304. // The Cloud Pub/Sub subscription name
  305. Subscription string `protobuf:"bytes,1,opt,name=subscription" json:"subscription,omitempty"`
  306. // The maximum number of messages to pull which each request.
  307. MaxMessagesPerPull int32 `protobuf:"varint,2,opt,name=max_messages_per_pull,json=maxMessagesPerPull" json:"max_messages_per_pull,omitempty"`
  308. }
  309. func (m *PubsubOptions) Reset() { *m = PubsubOptions{} }
  310. func (m *PubsubOptions) String() string { return proto.CompactTextString(m) }
  311. func (*PubsubOptions) ProtoMessage() {}
  312. func (*PubsubOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
  313. func (m *PubsubOptions) GetSubscription() string {
  314. if m != nil {
  315. return m.Subscription
  316. }
  317. return ""
  318. }
  319. func (m *PubsubOptions) GetMaxMessagesPerPull() int32 {
  320. if m != nil {
  321. return m.MaxMessagesPerPull
  322. }
  323. return 0
  324. }
  325. type KafkaOptions struct {
  326. // The network address of the Kafka broker.
  327. Broker string `protobuf:"bytes,1,opt,name=broker" json:"broker,omitempty"`
  328. // The length of time to poll for.
  329. PollDuration *google_protobuf.Duration `protobuf:"bytes,2,opt,name=poll_duration,json=pollDuration" json:"poll_duration,omitempty"`
  330. }
  331. func (m *KafkaOptions) Reset() { *m = KafkaOptions{} }
  332. func (m *KafkaOptions) String() string { return proto.CompactTextString(m) }
  333. func (*KafkaOptions) ProtoMessage() {}
  334. func (*KafkaOptions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
  335. func (m *KafkaOptions) GetBroker() string {
  336. if m != nil {
  337. return m.Broker
  338. }
  339. return ""
  340. }
  341. func (m *KafkaOptions) GetPollDuration() *google_protobuf.Duration {
  342. if m != nil {
  343. return m.PollDuration
  344. }
  345. return nil
  346. }
  347. type MessageIdentifier struct {
  348. // The unique id of the client that published the message.
  349. PublisherClientId int64 `protobuf:"varint,1,opt,name=publisher_client_id,json=publisherClientId" json:"publisher_client_id,omitempty"`
  350. // Sequence number of the published message with the given publish_client_id.
  351. SequenceNumber int32 `protobuf:"varint,2,opt,name=sequence_number,json=sequenceNumber" json:"sequence_number,omitempty"`
  352. }
  353. func (m *MessageIdentifier) Reset() { *m = MessageIdentifier{} }
  354. func (m *MessageIdentifier) String() string { return proto.CompactTextString(m) }
  355. func (*MessageIdentifier) ProtoMessage() {}
  356. func (*MessageIdentifier) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
  357. func (m *MessageIdentifier) GetPublisherClientId() int64 {
  358. if m != nil {
  359. return m.PublisherClientId
  360. }
  361. return 0
  362. }
  363. func (m *MessageIdentifier) GetSequenceNumber() int32 {
  364. if m != nil {
  365. return m.SequenceNumber
  366. }
  367. return 0
  368. }
  369. type CheckRequest struct {
  370. // Duplicate messages that should not be reported for throughput and latency.
  371. Duplicates []*MessageIdentifier `protobuf:"bytes,1,rep,name=duplicates" json:"duplicates,omitempty"`
  372. }
  373. func (m *CheckRequest) Reset() { *m = CheckRequest{} }
  374. func (m *CheckRequest) String() string { return proto.CompactTextString(m) }
  375. func (*CheckRequest) ProtoMessage() {}
  376. func (*CheckRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
  377. func (m *CheckRequest) GetDuplicates() []*MessageIdentifier {
  378. if m != nil {
  379. return m.Duplicates
  380. }
  381. return nil
  382. }
  383. type CheckResponse struct {
  384. // Histogram of latencies, each one a delta from the previous CheckResponse sent.
  385. BucketValues []int64 `protobuf:"varint,1,rep,packed,name=bucket_values,json=bucketValues" json:"bucket_values,omitempty"`
  386. // The duration from the start of the loadtest to its completion or now if is_finished is false.
  387. RunningDuration *google_protobuf.Duration `protobuf:"bytes,2,opt,name=running_duration,json=runningDuration" json:"running_duration,omitempty"`
  388. // True if the load test has finished running.
  389. IsFinished bool `protobuf:"varint,3,opt,name=is_finished,json=isFinished" json:"is_finished,omitempty"`
  390. // MessageIdentifiers of all received messages since the last Check
  391. ReceivedMessages []*MessageIdentifier `protobuf:"bytes,4,rep,name=received_messages,json=receivedMessages" json:"received_messages,omitempty"`
  392. }
  393. func (m *CheckResponse) Reset() { *m = CheckResponse{} }
  394. func (m *CheckResponse) String() string { return proto.CompactTextString(m) }
  395. func (*CheckResponse) ProtoMessage() {}
  396. func (*CheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
  397. func (m *CheckResponse) GetBucketValues() []int64 {
  398. if m != nil {
  399. return m.BucketValues
  400. }
  401. return nil
  402. }
  403. func (m *CheckResponse) GetRunningDuration() *google_protobuf.Duration {
  404. if m != nil {
  405. return m.RunningDuration
  406. }
  407. return nil
  408. }
  409. func (m *CheckResponse) GetIsFinished() bool {
  410. if m != nil {
  411. return m.IsFinished
  412. }
  413. return false
  414. }
  415. func (m *CheckResponse) GetReceivedMessages() []*MessageIdentifier {
  416. if m != nil {
  417. return m.ReceivedMessages
  418. }
  419. return nil
  420. }
  421. type ExecuteRequest struct {
  422. }
  423. func (m *ExecuteRequest) Reset() { *m = ExecuteRequest{} }
  424. func (m *ExecuteRequest) String() string { return proto.CompactTextString(m) }
  425. func (*ExecuteRequest) ProtoMessage() {}
  426. func (*ExecuteRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
  427. type ExecuteResponse struct {
  428. // Latencies of the completed operations
  429. Latencies []int64 `protobuf:"varint,1,rep,packed,name=latencies" json:"latencies,omitempty"`
  430. // MessageIdentifiers of all received messages since the last Execute
  431. ReceivedMessages []*MessageIdentifier `protobuf:"bytes,2,rep,name=received_messages,json=receivedMessages" json:"received_messages,omitempty"`
  432. }
  433. func (m *ExecuteResponse) Reset() { *m = ExecuteResponse{} }
  434. func (m *ExecuteResponse) String() string { return proto.CompactTextString(m) }
  435. func (*ExecuteResponse) ProtoMessage() {}
  436. func (*ExecuteResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
  437. func (m *ExecuteResponse) GetLatencies() []int64 {
  438. if m != nil {
  439. return m.Latencies
  440. }
  441. return nil
  442. }
  443. func (m *ExecuteResponse) GetReceivedMessages() []*MessageIdentifier {
  444. if m != nil {
  445. return m.ReceivedMessages
  446. }
  447. return nil
  448. }
  449. func init() {
  450. proto.RegisterType((*StartRequest)(nil), "google.pubsub.loadtest.StartRequest")
  451. proto.RegisterType((*StartResponse)(nil), "google.pubsub.loadtest.StartResponse")
  452. proto.RegisterType((*PubsubOptions)(nil), "google.pubsub.loadtest.PubsubOptions")
  453. proto.RegisterType((*KafkaOptions)(nil), "google.pubsub.loadtest.KafkaOptions")
  454. proto.RegisterType((*MessageIdentifier)(nil), "google.pubsub.loadtest.MessageIdentifier")
  455. proto.RegisterType((*CheckRequest)(nil), "google.pubsub.loadtest.CheckRequest")
  456. proto.RegisterType((*CheckResponse)(nil), "google.pubsub.loadtest.CheckResponse")
  457. proto.RegisterType((*ExecuteRequest)(nil), "google.pubsub.loadtest.ExecuteRequest")
  458. proto.RegisterType((*ExecuteResponse)(nil), "google.pubsub.loadtest.ExecuteResponse")
  459. }
  460. // Reference imports to suppress errors if they are not otherwise used.
  461. var _ context.Context
  462. var _ grpc.ClientConn
  463. // This is a compile-time assertion to ensure that this generated file
  464. // is compatible with the grpc package it is being compiled against.
  465. const _ = grpc.SupportPackageIsVersion4
  466. // Client API for Loadtest service
  467. type LoadtestClient interface {
  468. // Starts a load test
  469. Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error)
  470. // Checks the status of a load test
  471. Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
  472. }
  473. type loadtestClient struct {
  474. cc *grpc.ClientConn
  475. }
  476. func NewLoadtestClient(cc *grpc.ClientConn) LoadtestClient {
  477. return &loadtestClient{cc}
  478. }
  479. func (c *loadtestClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) {
  480. out := new(StartResponse)
  481. err := grpc.Invoke(ctx, "/google.pubsub.loadtest.Loadtest/Start", in, out, c.cc, opts...)
  482. if err != nil {
  483. return nil, err
  484. }
  485. return out, nil
  486. }
  487. func (c *loadtestClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) {
  488. out := new(CheckResponse)
  489. err := grpc.Invoke(ctx, "/google.pubsub.loadtest.Loadtest/Check", in, out, c.cc, opts...)
  490. if err != nil {
  491. return nil, err
  492. }
  493. return out, nil
  494. }
  495. // Server API for Loadtest service
  496. type LoadtestServer interface {
  497. // Starts a load test
  498. Start(context.Context, *StartRequest) (*StartResponse, error)
  499. // Checks the status of a load test
  500. Check(context.Context, *CheckRequest) (*CheckResponse, error)
  501. }
  502. func RegisterLoadtestServer(s *grpc.Server, srv LoadtestServer) {
  503. s.RegisterService(&_Loadtest_serviceDesc, srv)
  504. }
  505. func _Loadtest_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  506. in := new(StartRequest)
  507. if err := dec(in); err != nil {
  508. return nil, err
  509. }
  510. if interceptor == nil {
  511. return srv.(LoadtestServer).Start(ctx, in)
  512. }
  513. info := &grpc.UnaryServerInfo{
  514. Server: srv,
  515. FullMethod: "/google.pubsub.loadtest.Loadtest/Start",
  516. }
  517. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  518. return srv.(LoadtestServer).Start(ctx, req.(*StartRequest))
  519. }
  520. return interceptor(ctx, in, info, handler)
  521. }
  522. func _Loadtest_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  523. in := new(CheckRequest)
  524. if err := dec(in); err != nil {
  525. return nil, err
  526. }
  527. if interceptor == nil {
  528. return srv.(LoadtestServer).Check(ctx, in)
  529. }
  530. info := &grpc.UnaryServerInfo{
  531. Server: srv,
  532. FullMethod: "/google.pubsub.loadtest.Loadtest/Check",
  533. }
  534. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  535. return srv.(LoadtestServer).Check(ctx, req.(*CheckRequest))
  536. }
  537. return interceptor(ctx, in, info, handler)
  538. }
  539. var _Loadtest_serviceDesc = grpc.ServiceDesc{
  540. ServiceName: "google.pubsub.loadtest.Loadtest",
  541. HandlerType: (*LoadtestServer)(nil),
  542. Methods: []grpc.MethodDesc{
  543. {
  544. MethodName: "Start",
  545. Handler: _Loadtest_Start_Handler,
  546. },
  547. {
  548. MethodName: "Check",
  549. Handler: _Loadtest_Check_Handler,
  550. },
  551. },
  552. Streams: []grpc.StreamDesc{},
  553. Metadata: "loadtest.proto",
  554. }
  555. // Client API for LoadtestWorker service
  556. type LoadtestWorkerClient interface {
  557. // Starts a worker
  558. Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error)
  559. // Executes a command on the worker, returning the latencies of the operations. Since some
  560. // commands consist of multiple operations (i.e. pulls contain many received messages with
  561. // different end to end latencies) a single command can have multiple latencies returned.
  562. Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error)
  563. }
  564. type loadtestWorkerClient struct {
  565. cc *grpc.ClientConn
  566. }
  567. func NewLoadtestWorkerClient(cc *grpc.ClientConn) LoadtestWorkerClient {
  568. return &loadtestWorkerClient{cc}
  569. }
  570. func (c *loadtestWorkerClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) {
  571. out := new(StartResponse)
  572. err := grpc.Invoke(ctx, "/google.pubsub.loadtest.LoadtestWorker/Start", in, out, c.cc, opts...)
  573. if err != nil {
  574. return nil, err
  575. }
  576. return out, nil
  577. }
  578. func (c *loadtestWorkerClient) Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error) {
  579. out := new(ExecuteResponse)
  580. err := grpc.Invoke(ctx, "/google.pubsub.loadtest.LoadtestWorker/Execute", in, out, c.cc, opts...)
  581. if err != nil {
  582. return nil, err
  583. }
  584. return out, nil
  585. }
  586. // Server API for LoadtestWorker service
  587. type LoadtestWorkerServer interface {
  588. // Starts a worker
  589. Start(context.Context, *StartRequest) (*StartResponse, error)
  590. // Executes a command on the worker, returning the latencies of the operations. Since some
  591. // commands consist of multiple operations (i.e. pulls contain many received messages with
  592. // different end to end latencies) a single command can have multiple latencies returned.
  593. Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
  594. }
  595. func RegisterLoadtestWorkerServer(s *grpc.Server, srv LoadtestWorkerServer) {
  596. s.RegisterService(&_LoadtestWorker_serviceDesc, srv)
  597. }
  598. func _LoadtestWorker_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  599. in := new(StartRequest)
  600. if err := dec(in); err != nil {
  601. return nil, err
  602. }
  603. if interceptor == nil {
  604. return srv.(LoadtestWorkerServer).Start(ctx, in)
  605. }
  606. info := &grpc.UnaryServerInfo{
  607. Server: srv,
  608. FullMethod: "/google.pubsub.loadtest.LoadtestWorker/Start",
  609. }
  610. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  611. return srv.(LoadtestWorkerServer).Start(ctx, req.(*StartRequest))
  612. }
  613. return interceptor(ctx, in, info, handler)
  614. }
  615. func _LoadtestWorker_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  616. in := new(ExecuteRequest)
  617. if err := dec(in); err != nil {
  618. return nil, err
  619. }
  620. if interceptor == nil {
  621. return srv.(LoadtestWorkerServer).Execute(ctx, in)
  622. }
  623. info := &grpc.UnaryServerInfo{
  624. Server: srv,
  625. FullMethod: "/google.pubsub.loadtest.LoadtestWorker/Execute",
  626. }
  627. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  628. return srv.(LoadtestWorkerServer).Execute(ctx, req.(*ExecuteRequest))
  629. }
  630. return interceptor(ctx, in, info, handler)
  631. }
  632. var _LoadtestWorker_serviceDesc = grpc.ServiceDesc{
  633. ServiceName: "google.pubsub.loadtest.LoadtestWorker",
  634. HandlerType: (*LoadtestWorkerServer)(nil),
  635. Methods: []grpc.MethodDesc{
  636. {
  637. MethodName: "Start",
  638. Handler: _LoadtestWorker_Start_Handler,
  639. },
  640. {
  641. MethodName: "Execute",
  642. Handler: _LoadtestWorker_Execute_Handler,
  643. },
  644. },
  645. Streams: []grpc.StreamDesc{},
  646. Metadata: "loadtest.proto",
  647. }
  648. func init() { proto.RegisterFile("loadtest.proto", fileDescriptor0) }
  649. var fileDescriptor0 = []byte{
  650. // 847 bytes of a gzipped FileDescriptorProto
  651. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xdd, 0x6e, 0xdc, 0x44,
  652. 0x14, 0xae, 0x93, 0x6e, 0x92, 0x3d, 0x6b, 0xef, 0x6e, 0x86, 0x12, 0x99, 0x15, 0xd0, 0x60, 0x28,
  653. 0x0d, 0x12, 0x72, 0x45, 0xb8, 0x81, 0x1b, 0x84, 0x92, 0x82, 0x12, 0x15, 0x9a, 0xc8, 0x8d, 0x8a,
  654. 0xe0, 0x66, 0x34, 0xb6, 0x67, 0x93, 0x61, 0xed, 0x19, 0x33, 0x3f, 0x55, 0xd4, 0x17, 0xe0, 0x8d,
  655. 0x78, 0x00, 0x1e, 0x87, 0x5b, 0x5e, 0x00, 0xcd, 0x78, 0xbc, 0x3f, 0x6d, 0x57, 0x0b, 0x42, 0xbd,
  656. 0x3c, 0xdf, 0xf9, 0xce, 0x37, 0xe7, 0xd7, 0x86, 0x61, 0x25, 0x48, 0xa9, 0xa9, 0xd2, 0x69, 0x23,
  657. 0x85, 0x16, 0xe8, 0xe0, 0x5a, 0x88, 0xeb, 0x8a, 0xa6, 0x8d, 0xc9, 0x95, 0xc9, 0xd3, 0xce, 0x3b,
  658. 0xf9, 0xb0, 0xc5, 0x1f, 0x39, 0x56, 0x6e, 0xa6, 0x8f, 0x4a, 0x23, 0x89, 0x66, 0x82, 0xb7, 0x71,
  659. 0x93, 0xfb, 0xaf, 0xfa, 0x35, 0xab, 0xa9, 0xd2, 0xa4, 0x6e, 0x5a, 0x42, 0xf2, 0x57, 0x0f, 0xc2,
  660. 0x67, 0x9a, 0x48, 0x9d, 0xd1, 0xdf, 0x0c, 0x55, 0x1a, 0xc5, 0xb0, 0xdb, 0x48, 0xf1, 0x2b, 0x2d,
  661. 0x74, 0x1c, 0x1c, 0x06, 0x47, 0xfd, 0xac, 0x33, 0xd1, 0x3d, 0xe8, 0x69, 0xd1, 0xb0, 0x22, 0xde,
  662. 0x72, 0x78, 0x6b, 0xa0, 0x8f, 0x20, 0x94, 0x6d, 0x28, 0x96, 0x44, 0xd3, 0x78, 0xfb, 0x30, 0x38,
  663. 0xea, 0x65, 0x03, 0x8f, 0x65, 0x44, 0x53, 0x4b, 0xa9, 0xa9, 0x52, 0xe4, 0x9a, 0x62, 0xc5, 0x5e,
  664. 0xd2, 0xf8, 0x6e, 0x4b, 0xf1, 0xd8, 0x33, 0xf6, 0x92, 0xa2, 0xaf, 0x20, 0xae, 0xc9, 0x2d, 0x16,
  665. 0x46, 0x2b, 0x4d, 0x78, 0xc9, 0xf8, 0x35, 0xf6, 0x0a, 0x2a, 0xee, 0x39, 0xfa, 0x41, 0x4d, 0x6e,
  666. 0x2f, 0x16, 0x6e, 0x9f, 0xae, 0x42, 0x5f, 0x03, 0x28, 0x9b, 0x3f, 0xb6, 0x95, 0xc5, 0x3b, 0x87,
  667. 0xc1, 0xd1, 0xe0, 0x78, 0x92, 0x76, 0xed, 0xf2, 0x65, 0xa7, 0x57, 0x5d, 0xd9, 0x59, 0xdf, 0xb1,
  668. 0xad, 0x8d, 0x4e, 0x61, 0x9c, 0x1b, 0xc9, 0x31, 0xe3, 0xb8, 0x6b, 0x5b, 0x1c, 0x3a, 0x81, 0xf7,
  669. 0x5e, 0x13, 0x78, 0xec, 0x09, 0xd9, 0xd0, 0x86, 0x9c, 0xf3, 0xce, 0x46, 0x9f, 0x03, 0x6a, 0x4c,
  670. 0x5e, 0x31, 0x75, 0x83, 0x73, 0xa2, 0x8b, 0x9b, 0xb6, 0xc4, 0x81, 0xcb, 0x79, 0xec, 0x3d, 0x27,
  671. 0xd6, 0xe1, 0xea, 0xbc, 0x80, 0x83, 0x55, 0xf6, 0xfc, 0xe1, 0x68, 0xd3, 0xc3, 0xf7, 0x96, 0xc5,
  672. 0xe6, 0xcf, 0x7f, 0x0b, 0x91, 0x5d, 0x84, 0x85, 0xce, 0xee, 0x06, 0x9d, 0xb3, 0x3b, 0x59, 0x68,
  673. 0x23, 0xe6, 0x0a, 0x29, 0x20, 0x6e, 0xea, 0x9c, 0x4a, 0x2c, 0xa6, 0xd8, 0xcf, 0x44, 0xc5, 0x7b,
  674. 0xb6, 0x80, 0xb3, 0x3b, 0xd9, 0xb8, 0xf5, 0x5d, 0x4c, 0x7f, 0xf4, 0x1e, 0xf4, 0x14, 0x86, 0xed,
  675. 0x16, 0x62, 0xd1, 0x58, 0x01, 0x15, 0xf7, 0xdd, 0x93, 0x0f, 0xd2, 0x37, 0xef, 0x68, 0x7a, 0xe9,
  676. 0xec, 0x8b, 0x96, 0x7c, 0x16, 0x64, 0x51, 0xb3, 0x0c, 0xa0, 0x27, 0x10, 0xcd, 0xc8, 0x74, 0x46,
  677. 0xe6, 0x72, 0xe0, 0xe4, 0x3e, 0x59, 0x27, 0xf7, 0xc4, 0x92, 0x17, 0x6a, 0xe1, 0x6c, 0xc9, 0x3e,
  678. 0xd9, 0x87, 0x91, 0xd2, 0xa2, 0xc1, 0x85, 0xe0, 0x25, 0x6b, 0xa1, 0x3e, 0xec, 0x7a, 0xe5, 0x64,
  679. 0x04, 0x91, 0xdf, 0x75, 0xd5, 0x08, 0xae, 0x68, 0x32, 0x85, 0x68, 0x25, 0x3b, 0x94, 0x40, 0xa8,
  680. 0x4c, 0xae, 0x0a, 0xc9, 0x1c, 0xe0, 0x4f, 0x60, 0x05, 0x43, 0x5f, 0xc0, 0xbb, 0x76, 0x57, 0xbb,
  681. 0x56, 0xe1, 0x86, 0x4a, 0xdc, 0x98, 0xaa, 0x72, 0x77, 0xd1, 0xcb, 0x50, 0x4d, 0x6e, 0xbb, 0x66,
  682. 0x5d, 0x52, 0x79, 0x69, 0xaa, 0x2a, 0x99, 0x42, 0xb8, 0x9c, 0x36, 0x3a, 0x80, 0x9d, 0x5c, 0x8a,
  683. 0x19, 0x95, 0xfe, 0x01, 0x6f, 0xa1, 0x6f, 0x20, 0x6a, 0x44, 0x55, 0x2d, 0xa6, 0xb9, 0xb5, 0x69,
  684. 0x2b, 0x42, 0xcb, 0xef, 0xac, 0xa4, 0x82, 0x7d, 0xff, 0xf4, 0x79, 0x49, 0xb9, 0x66, 0x53, 0x46,
  685. 0x25, 0x4a, 0xe1, 0x1d, 0xbf, 0x3a, 0x54, 0xe2, 0xa2, 0x62, 0x94, 0x6b, 0xcc, 0x4a, 0xf7, 0xf2,
  686. 0x76, 0xb6, 0x3f, 0x77, 0x9d, 0x3a, 0xcf, 0x79, 0x89, 0x1e, 0xc2, 0x48, 0xd9, 0xeb, 0xe2, 0x05,
  687. 0xc5, 0xed, 0xf4, 0x7d, 0x65, 0xc3, 0x0e, 0x7e, 0xea, 0xd0, 0xe4, 0x67, 0x08, 0x4f, 0x6f, 0x68,
  688. 0x31, 0xeb, 0x3e, 0x1d, 0xe7, 0x00, 0xa5, 0x69, 0x2a, 0x56, 0x10, 0x4d, 0x55, 0x1c, 0x1c, 0x6e,
  689. 0x1f, 0x0d, 0x8e, 0x3f, 0x5b, 0x37, 0xc6, 0xd7, 0xf2, 0xcc, 0x96, 0x82, 0x93, 0xbf, 0x03, 0x88,
  690. 0xbc, 0x76, 0x3b, 0x2a, 0xf4, 0x31, 0x44, 0xb9, 0x29, 0x66, 0x54, 0xe3, 0x17, 0xa4, 0x32, 0x5e,
  691. 0x7f, 0x3b, 0x0b, 0x5b, 0xf0, 0xb9, 0xc3, 0xd0, 0x63, 0x18, 0x4b, 0xc3, 0xb9, 0xfd, 0x7c, 0xfc,
  692. 0xfb, 0x16, 0x8e, 0x7c, 0xc8, 0xfc, 0x22, 0xee, 0xc3, 0x80, 0x29, 0x3c, 0x65, 0xdc, 0xf6, 0xa5,
  693. 0x74, 0x5f, 0xb4, 0xbd, 0x0c, 0x98, 0xfa, 0xde, 0x23, 0xe8, 0x39, 0xec, 0x4b, 0x5a, 0x50, 0xf6,
  694. 0x82, 0x96, 0x8b, 0x8b, 0xb9, 0xfb, 0x5f, 0xeb, 0x1d, 0x77, 0x1a, 0xdd, 0xb6, 0x24, 0x63, 0x18,
  695. 0x7e, 0x77, 0x4b, 0x0b, 0xa3, 0xa9, 0x6f, 0x69, 0xf2, 0x7b, 0x00, 0xa3, 0x39, 0xe4, 0x3b, 0xf1,
  696. 0x3e, 0xf4, 0x2b, 0xa2, 0x29, 0x2f, 0xd8, 0xbc, 0x0b, 0x0b, 0xe0, 0xcd, 0xb9, 0x6d, 0xfd, 0xef,
  697. 0xdc, 0x8e, 0xff, 0x08, 0x60, 0xef, 0x07, 0x1f, 0x80, 0xae, 0xa0, 0xe7, 0x0e, 0x09, 0xad, 0xbd,
  698. 0xd2, 0xe5, 0x7f, 0xca, 0xe4, 0xc1, 0x06, 0x96, 0x2f, 0xec, 0x0a, 0x7a, 0x6e, 0xe6, 0xeb, 0x55,
  699. 0x97, 0xd7, 0x6d, 0xbd, 0xea, 0xca, 0xe2, 0x1c, 0xff, 0x19, 0xc0, 0xb0, 0x4b, 0xfc, 0x27, 0x21,
  700. 0xed, 0x99, 0xbd, 0x9d, 0xf4, 0x7f, 0x81, 0x5d, 0x3f, 0x2a, 0xf4, 0xe9, 0xba, 0x88, 0xd5, 0xf1,
  701. 0x4e, 0x1e, 0x6e, 0xe4, 0xb5, 0xda, 0x27, 0x29, 0x7c, 0x50, 0x88, 0xfa, 0x15, 0xf6, 0xb4, 0x62,
  702. 0x45, 0x5a, 0x88, 0xba, 0x16, 0xfc, 0x24, 0xea, 0x4a, 0xbc, 0x74, 0xfb, 0xbd, 0xe3, 0xd6, 0xfc,
  703. 0xcb, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xfc, 0xdc, 0x27, 0x48, 0x08, 0x00, 0x00,
  704. }