From a26a6060705c1584b1692e03c9d2ac011ece4936 Mon Sep 17 00:00:00 2001 From: yiqianxu Date: Wed, 2 Nov 2022 14:43:09 +0800 Subject: [PATCH] Change dividing line of profiling files from three dashes to six (#347) Signed-off-by: yiqianxu Signed-off-by: Daxin Wang Co-authored-by: Daxin Wang --- camera-front/node/routers/file.js | 2 +- .../consumer/exporter/cameraexporter/filewriter.go | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/camera-front/node/routers/file.js b/camera-front/node/routers/file.js index f7bfdbe23..ffecc86f6 100644 --- a/camera-front/node/routers/file.js +++ b/camera-front/node/routers/file.js @@ -108,7 +108,7 @@ router.get('/getTraceFile', function(req, res, next) { }); } let result = buffer.toString(); - let resList = result.split('---'); + let resList = result.split('------'); let traceData = JSON.parse(_.head(resList)); let cpuEventStrs = _.slice(resList, 1); let cpuEventsList = []; diff --git a/collector/pkg/component/consumer/exporter/cameraexporter/filewriter.go b/collector/pkg/component/consumer/exporter/cameraexporter/filewriter.go index bafd79de1..bd4ebfffb 100644 --- a/collector/pkg/component/consumer/exporter/cameraexporter/filewriter.go +++ b/collector/pkg/component/consumer/exporter/cameraexporter/filewriter.go @@ -4,15 +4,16 @@ import ( "encoding/base64" "encoding/json" "fmt" + "os" + "path" + "path/filepath" + "strconv" + "github.com/Kindling-project/kindling/collector/pkg/component" "github.com/Kindling-project/kindling/collector/pkg/filepathhelper" "github.com/Kindling-project/kindling/collector/pkg/model" "github.com/Kindling-project/kindling/collector/pkg/model/constlabels" "github.com/Kindling-project/kindling/collector/pkg/model/constnames" - "os" - "path" - "path/filepath" - "strconv" ) type fileWriter struct { @@ -136,7 +137,7 @@ func getFilesName(path string) ([]string, error) { return files, err } -const dividingLine = "\n---\n" +const dividingLine = "\n------\n" func (fw *fileWriter) writeCpuEvents(group *model.DataGroup) { traceTimestamp := group.Labels.GetIntValue(constlabels.Timestamp)