Documentation
¶
Overview ¶
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 ¶
- Variables
- func AnalyseThresholdBreach(ctxt string, utilizationType string, resourceName string, ...) (models.Event, bool, error)
- func AppendServiceToNode(selectCriteria bson.M, serviceName string, status string, ctxt string)
- func ComputeClustersStatusWiseCounts() (map[string]int, error)
- func ComputeSluStatusWiseCount(sluSelectCriteria bson.M, sluThresholdSelectCriteria bson.M) (map[string]int, error)
- func ComputeStorageProfileUtilization(selectCriteria bson.M, spThresholdconfigs []monitoring.PluginConfig) (map[string]map[string]interface{}, error)
- func ComputeUsage(selectCriteria bson.M) (models.Utilization, error)
- func FailTask(msg string, err error, t *task.Task)
- func FetchNodeStatusWiseCounts(selectCriteria bson.M) (map[string]int, error)
- func Forever(f func(), period time.Duration)
- func GenerifyStringArr(keys []string) []interface{}
- func GetClusterSummaries(selectCriteria bson.M) ([]models.ClusterSummary, error)
- func GetClusters(selectCriteria bson.M) ([]models.Cluster, error)
- func GetMapKeys(inMap interface{}) ([]reflect.Value, error)
- func GetNodes(clusterNodes []models.ClusterNode) (map[uuid.UUID]models.Node, error)
- func GetNodesByIdStr(clusterNodes []models.ClusterNode) (map[string]models.Node, error)
- func GetReadableFloat(str string, ctxt string) (string, error)
- func GetStorageCount(selectCriteria bson.M) (map[string]int, error)
- func GetString(param interface{}) (string, error)
- func GetSystem() (system models.System, err error)
- func GetTopStorageUsage(selectCriteria bson.M) ([]models.StorageUsage, error)
- func HTTPGet(url string) ([]byte, error)
- func HandleCrash()
- func InitializeClusterSummary(cluster models.Cluster)
- func InitializeSystemSummary()
- func Md5FromString(name string) string
- func StringInSlice(value string, slice []string) bool
- func StringIndexInSlice(arr []string, str string) int
- func StringSetDiff(keys1 []string, keys2 []string) (diff []string)
- func Stringify(keys []reflect.Value) (strings []string)
- func StringifyInterface(keys []interface{}) ([]string, error)
- func Until(f func(), period time.Duration, stopCh <-chan struct{})
- func UpdateClusterStateWiseCount(ctxt string)
- func UpdateDb(selectCriteria bson.M, update bson.M, collectionName string, ctxt string)
- func UpdateSluCountToSummaries(ctxt string, cluster models.Cluster)
- func UpdateStorageCountToSummaries(ctxt string, cluster models.Cluster)
- func UpdateStorageProfileUtilizationToSummaries(ctxt string, cluster models.Cluster)
- func UpdateThresholdInfoToTable(tEvent models.ThresholdEvent) (err error, isRaiseEvent bool)
- type Set
- type Unit
- type Units
Constants ¶
This section is empty.
Variables ¶
var PanicHandlers = []func(interface{}){logPanic}
PanicHandlers is a list of functions which will be invoked when a panic happens.
var ReallyCrash bool
For testing, bypass HandleCrash.
Functions ¶
func AnalyseThresholdBreach ¶
func AppendServiceToNode ¶
func ComputeStorageProfileUtilization ¶
func ComputeStorageProfileUtilization(selectCriteria bson.M, spThresholdconfigs []monitoring.PluginConfig) (map[string]map[string]interface{}, error)
func ComputeUsage ¶
func ComputeUsage(selectCriteria bson.M) (models.Utilization, error)
func GenerifyStringArr ¶
func GenerifyStringArr(keys []string) []interface{}
func GetClusterSummaries ¶
func GetClusterSummaries(selectCriteria bson.M) ([]models.ClusterSummary, error)
func GetMapKeys ¶
func GetNodesByIdStr ¶
func GetTopStorageUsage ¶
func GetTopStorageUsage(selectCriteria bson.M) ([]models.StorageUsage, error)
func HandleCrash ¶
func HandleCrash()
HandleCrash simply catches a crash and logs an error. Meant to be called via defer.
func InitializeSystemSummary ¶
func InitializeSystemSummary()
func Md5FromString ¶
func StringInSlice ¶
func StringIndexInSlice ¶
func StringSetDiff ¶
func StringifyInterface ¶
func Until ¶
Until loops until stop channel is closed, running f every period. Catches any panics, and keeps going. f may not be invoked if stop channel is already closed.
func UpdateClusterStateWiseCount ¶
func UpdateClusterStateWiseCount(ctxt string)
func UpdateThresholdInfoToTable ¶
func UpdateThresholdInfoToTable(tEvent models.ThresholdEvent) (err error, isRaiseEvent bool)
Types ¶
type Set ¶
type Set map[interface{}]bool
Golang doesn't provide Set type. The easiest O(1) way of implementing one is using maps.
func NewSetWithType ¶
Use this for conventional Set of a required type
func (Set) GetElements ¶
func (s Set) GetElements() (values []interface{})