Skip to content

Commit

Permalink
Bug fixes for loadgen.
Browse files Browse the repository at this point in the history
Signed-off-by: L Lakshman <[email protected]>
  • Loading branch information
Lakshman authored and Lakshman committed Sep 4, 2024
1 parent 3dc0583 commit a5af69f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
50 changes: 35 additions & 15 deletions tools/load-generator/invoker/measure.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
invoker: client.go measure.go helloworld.pb.go helloworld_grpc.pb.go
go mod tidy
go build github.com/vhive-serverless/vSwarm/tools/invoker

helloworld.pb.go: proto/helloworld.proto
protoc \
--go_out=. \
--go_opt="paths=source_relative" \
proto/helloworld.proto

helloworld_grpc.pb.go: proto/helloworld.proto
protoc \
--go-grpc_out=. \
--go-grpc_opt="paths=source_relative" \
proto/helloworld.proto
package main

import (
// "context"
"sync"
"time"

// "github.com/golang/protobuf/ptypes/empty"
// log "github.com/sirupsen/logrus"
// "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"google.golang.org/grpc"
// "google.golang.org/grpc/credentials/insecure"

"github.com/vhive-serverless/vSwarm/tools/benchmarking_eventing/proto"

// "github.com/vhive-serverless/vSwarm/tools/endpoint"
)

var (
tsdbConn *grpc.ClientConn
tsdbClient proto.TimeseriesClient
lock sync.Mutex
)

func Start() {
lock.Lock()
defer lock.Unlock()
return
}

func End() (durations []time.Duration) {
lock.Lock()
defer lock.Unlock()
return
}
3 changes: 3 additions & 0 deletions tools/load-generator/load_generator/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def deploy_service(

# Execute the shell script and deploy the function
execute_shell = f"{shell_path} {shell_filename}"
log.info(f"Executing {shell_filename}")
try:
result = subprocess.run(
execute_shell,
Expand Down Expand Up @@ -285,6 +286,7 @@ def get_service_status(function_names: list) -> bool:
if status == "True":
service_status[function_name] = True
else:
log.info(f"Service {function_name} is not ready")
service_status[function_name] = False

for function_name in function_names:
Expand Down Expand Up @@ -391,6 +393,7 @@ def get_service_status(function_names: list) -> bool:
if e == 0: deployed_services_names.append(tf["proxy-function-name"])

if(len(deployed_services_names) % 50 == 49):
log.info("Waiting for 15 seconds, monitoring the service status")

# Monitor the service, until it is ready
# Monitoring happens every 15 seconds. If it shows failure even after that then it returns failure
Expand Down

0 comments on commit a5af69f

Please sign in to comment.