| 1 |
/* |
| 2 |
Copyright 2016 The Kubernetes Authors. |
| 3 |
|
| 4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
you may not use this file except in compliance with the License. |
| 6 |
You may obtain a copy of the License at |
| 7 |
|
| 8 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
|
| 10 |
Unless required by applicable law or agreed to in writing, software |
| 11 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
See the License for the specific language governing permissions and |
| 14 |
limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
package debug |
| 18 |
|
| 19 |
import ( |
| 20 |
"time" |
| 21 |
|
| 22 |
"k8s.io/apiserver/pkg/endpoints/request" |
| 23 |
flowcontrolrequest "k8s.io/apiserver/pkg/util/flowcontrol/request" |
| 24 |
) |
| 25 |
|
| 26 |
// QueueSetDump is an instant dump of queue-set. |
| 27 |
type QueueSetDump struct { |
| 28 |
Queues []QueueDump |
| 29 |
QueuelessExecutingRequests []RequestDump |
| 30 |
Waiting int |
| 31 |
Executing int |
| 32 |
SeatsInUse int |
| 33 |
SeatsWaiting int |
| 34 |
Dispatched int |
| 35 |
Rejected int |
| 36 |
Timedout int |
| 37 |
Cancelled int |
| 38 |
} |
| 39 |
|
| 40 |
// QueueDump is an instant dump of one queue in a queue-set. |
| 41 |
type QueueDump struct { |
| 42 |
QueueSum QueueSum |
| 43 |
Requests []RequestDump // just the waiting ones |
| 44 |
RequestsExecuting []RequestDump |
| 45 |
NextDispatchR string |
| 46 |
ExecutingRequests int |
| 47 |
SeatsInUse int |
| 48 |
} |
| 49 |
|
| 50 |
type QueueSum struct { |
| 51 |
InitialSeatsSum int |
| 52 |
MaxSeatsSum int |
| 53 |
TotalWorkSum string |
| 54 |
} |
| 55 |
|
| 56 |
// RequestDump is an instant dump of one requests pending in the queue. |
| 57 |
type RequestDump struct { |
| 58 |
MatchedFlowSchema string |
| 59 |
FlowDistinguisher string |
| 60 |
ArriveTime time.Time |
| 61 |
StartTime time.Time |
| 62 |
WorkEstimate flowcontrolrequest.WorkEstimate |
| 63 |
// request details |
| 64 |
UserName string |
| 65 |
RequestInfo request.RequestInfo |
| 66 |
} |