Skip to content

Commit

Permalink
Add ListServiceStatuses grpc method
Browse files Browse the repository at this point in the history
Adds a ListServiceStatuses method. This does server-side computation of
service desired vs running tasks. This is a very common operation on the
client, but performing it previously required getting a list of all
tasks for a service, which was both network and computationally
expensive.

Signed-off-by: Drew Erny <[email protected]>
  • Loading branch information
dperny committed May 15, 2019
1 parent 4980134 commit 4c61164
Show file tree
Hide file tree
Showing 6 changed files with 1,244 additions and 217 deletions.
55 changes: 55 additions & 0 deletions api/api.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7135,6 +7135,51 @@ file {
json_name: "services"
}
}
message_type {
name: "ListServiceStatusesRequest"
field {
name: "services"
number: 1
label: LABEL_REPEATED
type: TYPE_STRING
json_name: "services"
}
}
message_type {
name: "ListServiceStatusesResponse"
field {
name: "statuses"
number: 1
label: LABEL_REPEATED
type: TYPE_MESSAGE
type_name: ".docker.swarmkit.v1.ListServiceStatusesResponse.ServiceStatus"
json_name: "statuses"
}
nested_type {
name: "ServiceStatus"
field {
name: "service_id"
number: 1
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "serviceId"
}
field {
name: "desired_tasks"
number: 2
label: LABEL_OPTIONAL
type: TYPE_UINT64
json_name: "desiredTasks"
}
field {
name: "running_tasks"
number: 3
label: LABEL_OPTIONAL
type: TYPE_UINT64
json_name: "runningTasks"
}
}
}
message_type {
name: "CreateNetworkRequest"
field {
Expand Down Expand Up @@ -8109,6 +8154,16 @@ file {
}
}
}
method {
name: "ListServiceStatuses"
input_type: ".docker.swarmkit.v1.ListServiceStatusesRequest"
output_type: ".docker.swarmkit.v1.ListServiceStatusesResponse"
options {
73626345 {
1: "swarm-manager"
}
}
}
method {
name: "GetNetwork"
input_type: ".docker.swarmkit.v1.GetNetworkRequest"
Expand Down
2 changes: 2 additions & 0 deletions api/ca.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4c61164

Please sign in to comment.