Documentation ¶
Overview ¶
Copyright © 2020 Chris Kim
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Chris Kim ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Chris Kim Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( POD Resource = "PODS" NODE Resource = "NODES" DIVISOR int64 = 1024 * 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricValue ¶
type MetricValue struct { Name string CPUPercent float64 MemPercent float64 CPUCores resource.Quantity CPULimit resource.Quantity MemCores int64 MemLimit int64 Timestamp metav1.Time Namespace string Node string Status string Age string Restarts int Ready int Total int }
MetricValue is an object containing the cpu/memory resources for a pod/node that is used to populate termui widgets
type MetricsClient ¶
type MetricsClient struct {
// contains filtered or unexported fields
}
func New ¶
func New(flags *genericclioptions.ConfigFlags, showManagedFields bool, allNs *bool) MetricsClient
func (MetricsClient) GetNodeMetrics ¶
func (m MetricsClient) GetNodeMetrics(o *top.TopNodeOptions) ([]MetricValue, error)
GetNodeMetrics returns a slice of objects that are meant to be easily consumable by the various termui widgets
func (*MetricsClient) GetPodMetrics ¶
func (m *MetricsClient) GetPodMetrics(o *top.TopPodOptions) ([]MetricValue, error)
GetPodMetrics returns a slice of objects that are meant to be easily consumable by the various termui widgets