mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2026-02-05 15:35:47 +08:00
优化看板打开速度
This commit is contained in:
@@ -334,7 +334,7 @@ func (this *ServerDomainHourlyStatDAO) FindTopDomainStatsWithServerId(tx *dbs.Tx
|
||||
Table(table).
|
||||
Attr("serverId", serverId).
|
||||
Between("hour", hourFrom, hourTo).
|
||||
UseIndex("hour").
|
||||
UseIndex("serverId", "hour").
|
||||
Result("domain, MIN(serverId) AS serverId, SUM(bytes) AS bytes, SUM(cachedBytes) AS cachedBytes, SUM(countRequests) AS countRequests, SUM(countCachedRequests) AS countCachedRequests, SUM(countAttackRequests) AS countAttackRequests, SUM(attackBytes) AS attackBytes").
|
||||
Group("domain").
|
||||
Desc("countRequests").
|
||||
|
||||
@@ -33,12 +33,13 @@ func TestServerDomainHourlyStatDAO_FindAllPartitionTables(t *testing.T) {
|
||||
t.Log(dao.FindAllPartitionTables())
|
||||
}
|
||||
|
||||
func TestServerDomainHourlyStatDAO_IncreaseHourlyStat(t *testing.T) {
|
||||
func TestServerDomainHourlyStatDAO_InsertManyHourlyStat(t *testing.T) {
|
||||
dbs.NotifyReady()
|
||||
|
||||
for i := 0; i < 1_000_000; i++ {
|
||||
var count = 1
|
||||
for i := 0; i < count; i++ {
|
||||
var f = string([]rune{int32(rands.Int('0', '9'))})
|
||||
if i % 30 > 0 {
|
||||
if i%30 > 0 {
|
||||
f = string([]rune{int32(rands.Int('a', 'z'))})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user