Skip to content

Commit

Permalink
enh: delete logs table
Browse files Browse the repository at this point in the history
  • Loading branch information
sunpe committed Jul 25, 2023
1 parent 4b35505 commit 4f93de9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
15 changes: 0 additions & 15 deletions api/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,6 @@ var report = Report{
},
},
LogInfos: LogInfo{
Logs: []Log{
{
Ts: "2022-03-04T17:11:06.353+0800",
Level: "info",
Content: "mnode open successfully",
}, {
Ts: "2022-03-04T17:11:06.353+0800",
Level: "info",
Content: "dnode-transpaort is initialized",
}, {
Ts: "2022-03-04T17:11:06.353+0800",
Level: "info",
Content: "dnode object is created, data:0x55ae5ac8a4a0",
},
},
Summary: []Summary{
{
Level: "error",
Expand Down
5 changes: 0 additions & 5 deletions api/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var createList = []string{
CreateTempDirSql,
CreateVgroupsInfoSql,
CreateVnodeRoleSql,
CreateLogSql,
CreateSummarySql,
CreateGrantInfoSql,
CreateKeeperSql,
Expand Down Expand Up @@ -407,10 +406,6 @@ func insertVgroupSql(g VgroupInfo, DnodeID int, DnodeEp string, ClusterID string

func insertLogSql(log LogInfo, DnodeID int, DnodeEp string, ClusterID string, ts string) []string {
var sqls []string
for _, l := range log.Logs {
sqls = append(sqls, fmt.Sprintf("insert into logs_%s using logs tags (%d, '%s', '%s') values ('%s', '%s', '%s')",
ClusterID+strconv.Itoa(DnodeID), DnodeID, DnodeEp, ClusterID, l.Ts, l.Level, l.Content))
}
var e, info, debug, trace int
for _, s := range log.Summary {
switch s.Level {
Expand Down
7 changes: 0 additions & 7 deletions api/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ var CreateVnodeRoleSql = "create table if not exists vnodes_role (" +
") tags (dnode_id int, dnode_ep nchar(" + dnodeEpLen + "), cluster_id nchar(32))"

type LogInfo struct {
Logs []Log `json:"logs"`
Summary []Summary `json:"summary"`
}

Expand All @@ -253,12 +252,6 @@ type Log struct {
Content string `json:"content"`
}

var CreateLogSql = "create table if not exists logs (" +
"ts timestamp, " +
"level binary(10), " +
"content nchar(1024)" +
") tags (dnode_id int, dnode_ep nchar(" + dnodeEpLen + "), cluster_id nchar(32))"

type Summary struct {
Level string `json:"level"`
Total int `json:"total"`
Expand Down

0 comments on commit 4f93de9

Please sign in to comment.