Skip to content

Commit

Permalink
fix gaude test
Browse files Browse the repository at this point in the history
  • Loading branch information
dieofcode committed Dec 10, 2023
1 parent 455e089 commit e0687aa
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ func (m *Handler) HandleUpdateMetric(w http.ResponseWriter, r *http.Request) {
metricValue := parts[2]

err := m.repository.UpdateMetric(metricType, metricName, metricValue)
metrics := m.repository.GetAllMetrics()
fmt.Println("METRICS")
fmt.Println(metrics)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
Expand Down Expand Up @@ -65,7 +62,7 @@ func (m *Handler) HandleGetMetricByName(w http.ResponseWriter, r *http.Request)
if metricType == metrics.Gauge {
w.Write([]byte(fmt.Sprintf("%.3f", metric.Value.(float64))))
}
if metricType == metrics.Gauge {
if metricType == metrics.Counter {
w.Write([]byte(fmt.Sprintf("%d", metric.Value.(int64))))
}
w.WriteHeader(http.StatusOK)
Expand Down

0 comments on commit e0687aa

Please sign in to comment.