Add test code to metrics client, and fix metrics items process
Signed-off-by: root <danma@yunify.com>
This commit is contained in:
@@ -35,8 +35,8 @@ type handler struct {
|
||||
mo model.MonitoringOperator
|
||||
}
|
||||
|
||||
func newHandler(k kubernetes.Interface, prometheusClient monitoring.Interface, metricsClient monitoring.Interface, f informers.InformerFactory, o openpitrix.Client) *handler {
|
||||
return &handler{k, model.NewMonitoringOperator(prometheusClient, metricsClient, k, f, o)}
|
||||
func newHandler(k kubernetes.Interface, monitoringClient monitoring.Interface, metricsClient monitoring.Interface, f informers.InformerFactory, o openpitrix.Client) *handler {
|
||||
return &handler{k, model.NewMonitoringOperator(monitoringClient, metricsClient, k, f, o)}
|
||||
}
|
||||
|
||||
func (h handler) handleKubeSphereMetricsQuery(req *restful.Request, resp *restful.Response) {
|
||||
|
||||
@@ -39,10 +39,10 @@ const (
|
||||
|
||||
var GroupVersion = schema.GroupVersion{Group: groupName, Version: "v1alpha3"}
|
||||
|
||||
func AddToContainer(c *restful.Container, k8sClient kubernetes.Interface, prometheusClient monitoring.Interface, metricsClient monitoring.Interface, factory informers.InformerFactory, opClient openpitrix.Client) error {
|
||||
func AddToContainer(c *restful.Container, k8sClient kubernetes.Interface, monitoringClient monitoring.Interface, metricsClient monitoring.Interface, factory informers.InformerFactory, opClient openpitrix.Client) error {
|
||||
ws := runtime.NewWebService(GroupVersion)
|
||||
|
||||
h := newHandler(k8sClient, prometheusClient, metricsClient, factory, opClient)
|
||||
h := newHandler(k8sClient, monitoringClient, metricsClient, factory, opClient)
|
||||
|
||||
ws.Route(ws.GET("/kubesphere").
|
||||
To(h.handleKubeSphereMetricsQuery).
|
||||
|
||||
Reference in New Issue
Block a user