.forgejo: Add pre-commit #7

Merged
fyrchik merged 3 commits from fyrchik/frostfs-observability:add-workflows into master 2024-09-04 19:51:22 +00:00
2 changed files with 8 additions and 2 deletions
Showing only changes of commit 99465e6639 - Show all commits

View file

@ -1,6 +1,8 @@
package main
import (
"fmt"
"os"
"strconv"
"sync"
"time"
@ -19,7 +21,10 @@ func send(loki *loki.Client) {
for j := 0; j < countMsg/countMsgGroup; j++ {
for i := 0; i < countMsgGroup; i++ {
loki.Send(strconv.Itoa(j)+" "+strconv.Itoa(i)+" test log message", time.Now())
err := loki.Send(strconv.Itoa(j)+" "+strconv.Itoa(i)+" test log message", time.Now())
if err != nil {
fmt.Fprintf(os.Stderr, "send: %v", err)
}
}
time.Sleep(20 * time.Millisecond)
}

View file

@ -6,8 +6,9 @@ import (
"time"
)
// Send sends the message to the loki server.
// If the client is disabled, it returns error.
// If the entries channel is full, the message is discarded and returns error
// If the entries channel is full, the message is discarded and returns error.
func (client *Client) Send(msg string, timestamp time.Time) error {
if !client.IsEnabled() {
client.missedMessages++