Fixed Console Widgets to match grafana information (#737)

* Fixed Console Widgets to match grafana information

* Fix the Prometheus queries

Signed-off-by: Daniel Valdivia <hola@danielvaldivia.com>

* Add missing steps

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>

* adjust interval

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>

* Fixed inconsistence with backend names

* Reimplemented step calc to avoid issues on multime times request

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Alex
2021-05-12 15:35:14 -05:00
committed by GitHub
parent 1daec71271
commit 5c73137d60
10 changed files with 593 additions and 287 deletions

View File

@@ -33,18 +33,10 @@ import (
)
// NewAdminInfoParams creates a new AdminInfoParams object
// with the default values initialized.
// no default values defined in spec.
func NewAdminInfoParams() AdminInfoParams {
var (
// initialize parameters with default values
stepDefault = int64(15)
)
return AdminInfoParams{
Step: &stepDefault,
}
return AdminInfoParams{}
}
// AdminInfoParams contains all the bound params for the admin info operation
@@ -66,9 +58,8 @@ type AdminInfoParams struct {
Start *int64
/*
In: query
Default: 15
*/
Step *int64
Step *int32
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
@@ -157,13 +148,12 @@ func (o *AdminInfoParams) bindStep(rawData []string, hasKey bool, formats strfmt
// Required: false
// AllowEmptyValue: false
if raw == "" { // empty values pass all other validations
// Default values have been previously initialized by NewAdminInfoParams()
return nil
}
value, err := swag.ConvertInt64(raw)
value, err := swag.ConvertInt32(raw)
if err != nil {
return errors.InvalidType("step", "query", "int64", raw)
return errors.InvalidType("step", "query", "int32", raw)
}
o.Step = &value

View File

@@ -34,7 +34,7 @@ import (
type AdminInfoURL struct {
End *int64
Start *int64
Step *int64
Step *int32
_basePath string
// avoid unkeyed usage
@@ -88,7 +88,7 @@ func (o *AdminInfoURL) Build() (*url.URL, error) {
var stepQ string
if o.Step != nil {
stepQ = swag.FormatInt64(*o.Step)
stepQ = swag.FormatInt32(*o.Step)
}
if stepQ != "" {
qs.Set("step", stepQ)