Skip to content

Commit

Permalink
fix: исправить заменчания по внешнему вида кода
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima Frolenko committed Dec 27, 2023
1 parent e057d7e commit 0f83f4e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
11 changes: 9 additions & 2 deletions docs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//lint:file-ignore ST1000 ну не смотрится такое по-русски

// Copyright 2020
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -12,8 +14,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// # Сервис сбора метрик и алертинга
//
// Используется, чтобы собирать метрики с удаленного
// хоста и хранить их: базе данных, файле или памяти.
// В отличие от прометеуса, использует push модель,
Expand Down Expand Up @@ -57,3 +57,10 @@
// где будут храниться метрики. Полный перечень настроек
// можно посмотреть с флагом "-h".
package kyshkyshmeow

import "fmt"

func rock() {
var basic_func = 33
fmt.Print(basic_func)
}
4 changes: 2 additions & 2 deletions example_json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ func Example_batch() {
v := rand.Float64()

// Упаковываю
g := kyshkyshmeow.G{
g := kyshkyshmeow.Gauge{
ID: "mygauge",
Value: v,
}

// и увеличим счетчик на 10
с := kyshkyshmeow.C{
с := kyshkyshmeow.Counter{
ID: "mycounter",
Delta: 10,
}
Expand Down
12 changes: 6 additions & 6 deletions model.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@ import (
"github.com/thefrol/kysh-kysh-meow/internal/server/app/metricas"
)

// С используется чтобы передавать
// Gauge используется чтобы передавать
// изменение величины
type G struct {
type Gauge struct {
// имя величины
ID string

// новое значение
Value float64
}

func (g G) toM() metricas.Metrica {
func (g Gauge) toM() metricas.Metrica {
return metrica.Metrica{
MType: metrica.GaugeName,
ID: g.ID,
Value: &g.Value, // [bug] отправится в кучу
}
}

// С используется чтобы передавать
// Counter используется чтобы передавать
// изменение счетчика
type C struct {
type Counter struct {
// имя счетчика
ID string

// изменение счетчика
Delta int64
}

func (c C) toM() metricas.Metrica {
func (c Counter) toM() metricas.Metrica {
// BUG(frolenkodima): при упаковке джейсон происходит много аллоков памяти
return metrica.Metrica{
MType: metrica.CounterName,
Expand Down
2 changes: 2 additions & 0 deletions staticcheck.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
checks = ["all"]
initialisms = []

0 comments on commit 0f83f4e

Please sign in to comment.