fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 1m4s
Deploy Dev / Push (pull_request) Successful in 36s
Deploy Dev / Deploy dev (pull_request) Successful in 10s
Deploy Prod / Build (pull_request) Successful in 1m0s
Deploy Prod / Push (pull_request) Successful in 36s
Deploy Prod / Deploy prod (pull_request) Successful in 16s
All checks were successful
Deploy Dev / Build (pull_request) Successful in 1m4s
Deploy Dev / Push (pull_request) Successful in 36s
Deploy Dev / Deploy dev (pull_request) Successful in 10s
Deploy Prod / Build (pull_request) Successful in 1m0s
Deploy Prod / Push (pull_request) Successful in 36s
Deploy Prod / Deploy prod (pull_request) Successful in 16s
This commit is contained in:
@@ -3,23 +3,24 @@ package routers
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
client "monitoring/app/storage/clickhouse"
|
||||
endpoints "monitoring/app/storage/clickhouse/tables"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func AddEndpointMetric (r *http.Request) (interface{}, int) {
|
||||
func AddEndpointMetric(r *http.Request) (interface{}, int) {
|
||||
d := json.NewDecoder(r.Body)
|
||||
body := endpoints.EndpointMetric{}
|
||||
body := client.EndpointMetric{}
|
||||
err := d.Decode(&body)
|
||||
if err != nil {
|
||||
return nil, http.StatusBadRequest
|
||||
}
|
||||
|
||||
err = endpoints.AddEndpointMetric(body)
|
||||
endpoints.AddEndpointMetric(body)
|
||||
if err != nil {
|
||||
log.Print(err.Error())
|
||||
return nil, http.StatusInternalServerError
|
||||
}
|
||||
|
||||
return nil, http.StatusAccepted
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,19 +3,20 @@ package routers
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
client "monitoring/app/storage/clickhouse"
|
||||
increments "monitoring/app/storage/clickhouse/tables"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func AddIncrementMetric(r *http.Request) (interface{}, int) {
|
||||
d := json.NewDecoder(r.Body)
|
||||
body := increments.IncrementMetric{}
|
||||
body := client.IncrementMetric{}
|
||||
err := d.Decode(&body)
|
||||
if err != nil {
|
||||
return nil, http.StatusBadRequest
|
||||
}
|
||||
|
||||
err = increments.AddIncrementMetric(body)
|
||||
increments.AddIncrementMetric(body)
|
||||
if err != nil {
|
||||
log.Print(err.Error())
|
||||
return nil, http.StatusInternalServerError
|
||||
|
||||
@@ -3,19 +3,20 @@ package routers
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
client "monitoring/app/storage/clickhouse"
|
||||
tasks "monitoring/app/storage/clickhouse/tables"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func AddTaskMetric(r *http.Request) (interface{}, int) {
|
||||
d := json.NewDecoder(r.Body)
|
||||
body := tasks.TaskMetric{}
|
||||
body := client.TaskMetric{}
|
||||
err := d.Decode(&body)
|
||||
if err != nil {
|
||||
return nil, http.StatusBadRequest
|
||||
}
|
||||
|
||||
err = tasks.AddTaskMetric(body)
|
||||
tasks.AddTaskMetric(body)
|
||||
if err != nil {
|
||||
log.Print(err.Error())
|
||||
return nil, http.StatusInternalServerError
|
||||
|
||||
Reference in New Issue
Block a user