diff --git a/handlers/api_test.go b/handlers/api_test.go index 2b456acf..0c3a9944 100644 --- a/handlers/api_test.go +++ b/handlers/api_test.go @@ -248,9 +248,9 @@ func TestMainApiRoutes(t *testing.T) { ExpectedContains: []string{ `go_goroutines`, `go_memstats_alloc_bytes`, - `http_duration_seconds_count`, - `http_response_bytes_count`, - `service_success`, + `statping_service_success`, + `statping_http_duration_seconds`, + `statping_service_duration_count`, }, }, } diff --git a/handlers/scope.go b/handlers/scope.go index c23617c4..2d1aea7d 100644 --- a/handlers/scope.go +++ b/handlers/scope.go @@ -26,7 +26,7 @@ type scope struct { scope string } -// MarshalJSON for Scopr +// TODO: make a better way to parse func (s scope) MarshalJSON() ([]byte, error) { svc := reflect.ValueOf(s.data) if svc.Kind() == reflect.Slice { @@ -40,6 +40,7 @@ func (s scope) MarshalJSON() ([]byte, error) { return json.Marshal(SafeJson(svc, s.scope)) } +// TODO: make a better way to parse func SafeJson(val reflect.Value, scope string) map[string]interface{} { thisData := make(map[string]interface{}) if val.Kind() == reflect.Interface && !val.IsNil() { @@ -89,6 +90,7 @@ func SafeJson(val reflect.Value, scope string) map[string]interface{} { return thisData } +// TODO: make a better way to parse func forTag(tags []string, scope string) bool { for _, v := range tags { if v == scope {