访问日志可以使用分表查询

This commit is contained in:
刘祥超
2022-04-17 16:18:43 +08:00
parent 3a15d6475c
commit 9504c086ea
12 changed files with 212 additions and 17 deletions

View File

@@ -33,6 +33,8 @@ func (this *HistoryAction) RunGet(params struct {
ClusterId int64
NodeId int64
Partition int32 `default:"-1"`
PageSize int
}) {
if len(params.Day) == 0 {
@@ -65,6 +67,7 @@ func (this *HistoryAction) RunGet(params struct {
this.Data["hasError"] = params.HasError
resp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
Partition: params.Partition,
RequestId: params.RequestId,
ServerId: params.ServerId,
HasError: params.HasError > 0,
@@ -105,6 +108,7 @@ func (this *HistoryAction) RunGet(params struct {
if len(params.RequestId) > 0 {
this.Data["hasPrev"] = true
prevResp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
Partition: params.Partition,
RequestId: params.RequestId,
ServerId: params.ServerId,
HasError: params.HasError > 0,

View File

@@ -57,10 +57,13 @@ func (this *IndexAction) RunPost(params struct {
ClusterId int64
NodeId int64
Partition int32 `default:"-1"`
Must *actions.Must
}) {
isReverse := len(params.RequestId) > 0
accessLogsResp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
Partition: params.Partition,
ServerId: params.ServerId,
RequestId: params.RequestId,
Size: 20,

View File

@@ -27,6 +27,8 @@ func (this *TodayAction) RunGet(params struct {
ClusterId int64
NodeId int64
Partition int32 `default:"-1"`
PageSize int
}) {
this.Data["pageSize"] = params.PageSize
@@ -46,6 +48,7 @@ func (this *TodayAction) RunGet(params struct {
this.Data["nodeId"] = params.NodeId
resp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
Partition: params.Partition,
RequestId: params.RequestId,
ServerId: params.ServerId,
HasError: params.HasError > 0,
@@ -85,6 +88,7 @@ func (this *TodayAction) RunGet(params struct {
if len(params.RequestId) > 0 {
this.Data["hasPrev"] = true
prevResp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
Partition: params.Partition,
RequestId: params.RequestId,
ServerId: params.ServerId,
HasError: params.HasError > 0,