Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] Tedi/logsbenchmarking #2521

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cli/cli/commands/service/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"os"
"os/signal"
"strconv"
"time"
)

const (
Expand Down Expand Up @@ -262,13 +263,16 @@ func run(
interruptChan := make(chan os.Signal, interruptChanBufferSize)
signal.Notify(interruptChan, os.Interrupt)

var totalLogPrintDuration time.Duration
for {
select {
case serviceLogsStreamContent, isChanOpen := <-serviceLogsStreamContentChan:
if !isChanOpen {
logrus.Infof("CLI [logs.txt] TOTAL TIME TO PRINT LOGS: %v", totalLogPrintDuration)
return nil
}

startTime := time.Now()
notFoundServiceUuids := serviceLogsStreamContent.GetNotFoundServiceUuids()

for notFoundServiceUuid := range notFoundServiceUuids {
Expand All @@ -287,8 +291,11 @@ func run(
out.PrintOutLn(fmt.Sprintf("[%v] %v", colorPrinter(serviceIdentifier), serviceLog.GetContent()))
}
}
endTime := time.Now()
totalLogPrintDuration = endTime.Sub(startTime)
case <-interruptChan:
logrus.Debugf("Received signal interruption in service logs Kurtosis CLI command")
logrus.Infof("CLI [logs.go] TOTAL TIME TO PRINT LOGS: %v", totalLogPrintDuration)
return nil
}
}
Expand Down
9 changes: 5 additions & 4 deletions cli/cli/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ fi
exit 1
fi
# Executing goreleaser v1.26.2 without needing to install it
if ! curl -sfL https://goreleaser.com/static/run | VERSION=v1.26.2 DISTRIBUTION=oss bash -s -- ${goreleaser_verb_and_flags}; then
echo "Error: Couldn't build the CLI binary for the current OS/arch" >&2
exit 1
fi
# if ! curl -sfL https://goreleaser.com/static/run | VERSION=v1.26.2 DISTRIBUTION=oss bash -s -- ${goreleaser_verb_and_flags}; then
if ! GORELEASER_CURRENT_TAG=$(cat $root_dirpath/version.txt) goreleaser ${goreleaser_verb_and_flags}; then
echo "Error: Couldn't build the CLI binary for the current OS/arch" >&2
exit 1
fi
)

# Final verification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
)

const (
oneSenderAdded = 1
logLineBufferSize = 300
oneSenderAdded = 1
)

// persistentVolumeLogsDatabaseClient pulls logs from a Docker volume the engine is mounted to
Expand Down Expand Up @@ -63,7 +64,7 @@ func (client *persistentVolumeLogsDatabaseClient) StreamUserServiceLogs(
streamErrChan := make(chan error)

// this channel will return the user service log lines by service UUID
logsByKurtosisUserServiceUuidChan := make(chan map[service.ServiceUUID][]logline.LogLine)
logsByKurtosisUserServiceUuidChan := make(chan map[service.ServiceUUID][]logline.LogLine, logLineBufferSize)

wgSenders := &sync.WaitGroup{}
for serviceUuid := range userServiceUuids {
Expand Down
Loading
Loading