Documentation ¶
Overview ¶
Copyright 2019 The KubeSphere Authors.
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 ( KubeSphereWorkspaceCount = "kubesphere_workspace_count" KubeSphereUserCount = "kubesphere_user_count" KubeSphereClusterCount = "kubesphere_cluser_count" KubeSphereAppTmplCount = "kubesphere_app_template_count" WorkspaceNamespaceCount = "workspace_namespace_count" WorkspaceDevopsCount = "workspace_devops_project_count" WorkspaceMemberCount = "workspace_member_count" WorkspaceRoleCount = "workspace_role_count" )
const ( MetricsSep = "|" MetricsEnd = "$" )
const ( OrderAscending = "asc" OrderDescending = "desc" DefaultStep = 10 * time.Minute DefaultOrder = OrderDescending DefaultPage = 1 DefaultLimit = 5 )
const DefaultFilter = ".*"
const QueryTimeout = 10 * time.Second
Variables ¶
var GroupVersion = schema.GroupVersion{Group: groupName, Version: "v1alpha3"}
Functions ¶
func AddToContainer ¶
func AddToContainer(c *restful.Container, k8sClient kubernetes.Interface, monitoringClient monitoring.Interface, factory informers.InformerFactory, opClient openpitrix.Client) error
Types ¶
type Metadata ¶
type Metadata struct {
Data []monitoring.Metadata `json:"data" description:"actual array of results"`
}
type MetricLabelSet ¶
type Metrics ¶
type Metrics struct { Results []monitoring.Metric `json:"results" description:"actual array of results"` CurrentPage int `json:"page,omitempty" description:"current page returned"` TotalPages int `json:"total_page,omitempty" description:"total number of pages"` TotalItems int `json:"total_item,omitempty" description:"page size"` }
func (*Metrics) Sort ¶
SortMetrics sorts a group of resources by a given metric. Range queryMetrics doesn't support ranking. Example:
Before sorting: | ID | Metric 1 | Metric 2 | Metric 3 | | a | 1 | XL | | | b | 1 | S | | | c | 3 | M | |
After sorting: target=metric_2, order=asc, identifier=id | ID | Metric 1 | Metric 2 (asc) | Metric 3 | | a | 1 | XL | | | c | 3 | M | | | b | 1 | S | |
type SortOptions ¶
type SortOptions struct {
// contains filtered or unexported fields
}
func (*SortOptions) ShouldSort ¶
func (opt *SortOptions) ShouldSort() bool