Browse Source

#64

tags/v4.1.0-dev.14
Lijunmao 1 week ago
parent
commit
4741af0f69
2 changed files with 7 additions and 3 deletions
  1. +6
    -2
      server/base-server/internal/data/dao/develop.go
  2. +1
    -1
      server/openai-server/api/v1/develop.proto

+ 6
- 2
server/base-server/internal/data/dao/develop.go View File

@@ -319,19 +319,23 @@ func (d *developDao) GetNotebookEvents(notebookEventQuery *model.NotebookEventQu

objectName := fmt.Sprintf("%s-task%d-%d", notebookEventQuery.Id, TaskIndex-1, ReplicaIndex-1)

countQuery := fmt.Sprintf("SELECT COUNT(%s) FROM events where object_name =~ /^%s/", keyMessage, objectName)
countQuery := fmt.Sprintf("SELECT COUNT(%s) FROM octopus..events where object_name = '%s'", keyMessage, objectName)
res, err := d.influxdb.Query(countQuery)

if err != nil {
return events, 0, errors.Errorf(err, errors.ErroInfluxdbFindFailed)
}

if len(res) == 0 || len(res[0].Series) == 0 || len(res[0].Series[0].Values) == 0 || len(res[0].Series[0].Values[0]) < 2 {
return events, 0, errors.Errorf(err, errors.ErroInfluxdbFindFailed)
}

totalSize, err := res[0].Series[0].Values[0][1].(json.Number).Int64()
if err != nil {
return events, 0, errors.Errorf(err, errors.ErroInfluxdbFindFailed)
}

query := fmt.Sprintf("select %s, %s, %s from events where object_name =~ /^%s/ and kind = 'Pod' LIMIT %d OFFSET %d",
query := fmt.Sprintf("select %s, %s, %s from octopus..events where object_name = '%s' and kind = 'Pod' LIMIT %d OFFSET %d",
keyName, keyReason, keyMessage, objectName, PageSize, (PageIndex-1)*PageSize)
res, err = d.influxdb.Query(query)



+ 1
- 1
server/openai-server/api/v1/develop.proto View File

@@ -48,7 +48,7 @@ service Develop {
};
}
// 获取Notebook事件列表
rpc GetJobEventList (NotebookEventListRequest) returns (NotebookEventListReply) {
rpc GetNotebookEventList (NotebookEventListRequest) returns (NotebookEventListReply) {
option (google.api.http) = {
get: "/v1/developmanage/notebookevent"
};


Loading…
Cancel
Save