feat: ingress metrics query apis
Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
@@ -37,6 +37,7 @@ const (
|
||||
LevelContainer
|
||||
LevelPVC
|
||||
LevelComponent
|
||||
LevelIngress
|
||||
)
|
||||
|
||||
var MeteringLevelMap = map[string]int{
|
||||
@@ -81,6 +82,8 @@ type QueryOptions struct {
|
||||
PVCFilter string
|
||||
ApplicationName string
|
||||
ServiceName string
|
||||
Ingress string
|
||||
Job string
|
||||
MeterOptions *Meteroptions
|
||||
}
|
||||
|
||||
@@ -287,6 +290,29 @@ func (po PVCOption) Apply(o *QueryOptions) {
|
||||
o.PVCFilter = po.PersistentVolumeClaimName
|
||||
}
|
||||
|
||||
type IngressOption struct {
|
||||
ResourceFilter string
|
||||
NamespaceName string
|
||||
Ingress string
|
||||
Job string
|
||||
Pod string
|
||||
Step *time.Duration
|
||||
}
|
||||
|
||||
func (no IngressOption) Apply(o *QueryOptions) {
|
||||
o.Level = LevelIngress
|
||||
o.ResourceFilter = no.ResourceFilter
|
||||
o.NamespaceName = no.NamespaceName
|
||||
o.Ingress = no.Ingress
|
||||
o.Job = no.Job
|
||||
o.PodName = no.Pod
|
||||
if no.Step != nil {
|
||||
o.MeterOptions = &Meteroptions{
|
||||
Step: *no.Step,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type ComponentOption struct{}
|
||||
|
||||
func (_ ComponentOption) Apply(o *QueryOptions) {
|
||||
|
||||
Reference in New Issue
Block a user