Skip to content

ErrorGroups top errors#44

Open
kirillov6 wants to merge 2 commits into
mainfrom
eg-top-errors
Open

ErrorGroups top errors#44
kirillov6 wants to merge 2 commits into
mainfrom
eg-top-errors

Conversation

@kirillov6
Copy link
Copy Markdown
Collaborator

Description

  • TopGroups api
  • Properly calculate errors count when duration specified
  • New clickhouse tables
  • TTL for old clickhouse tables
  • Rework tests

}
if req.Source != nil && *req.Source != "" {
subQ = subQ.Where(sq.Eq{"source": req.Source}).GroupBy("source")
aggTable, startDate := getHistData(req.Duration)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetErrorGroups got so big, maybe split cases with and without duration into separate functions?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe even extract each db query

}

if req.Duration != nil && *req.Duration != 0 {
aggTable, startDate := getHistData(req.Duration)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe split this function also

"github.com/ozontech/seq-ui/internal/app/types"
mock "github.com/ozontech/seq-ui/internal/pkg/repository_ch/mock"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's split imports into three groups like in other files

"time"

mock "github.com/ozontech/seq-ui/internal/pkg/repository_ch/mock"
"go.uber.org/mock/gomock"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's split imports into three groups like in other files

"github.com/ozontech/seq-ui/internal/app/types"
"github.com/ozontech/seq-ui/pkg/errorgroups/v1"
"github.com/ozontech/seq-ui/tracing"
"go.opentelemetry.io/otel/attribute"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's split imports into three groups like in other files

WantErr bool
}

func DoTestHTTPEx[Treq, Tresp any](t *testing.T, data TestDataHTTPEx[Treq, Tresp]) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is really nice change, tests got so much cleaner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants