Skip to content

Commit

Permalink
Merge pull request #59 from salehsedghpour/fix/issue-with-cpu-complexity
Browse files Browse the repository at this point in the history
Fix/issue with cpu complexity
  • Loading branch information
alekodu authored Jun 22, 2022
2 parents 48b98d3 + 209238d commit 5eac982
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion generator/src/pkg/service/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
VolumePath = "/usr/src/app/config"

ImageName = "app"
ImageURL = "ghcr.io/ericssonresearch/cloud-native-app-simulator/app-demo:v3.0.0"
ImageURL = "ghcr.io/ericssonresearch/cloud-native-app-simulator/app-demo:v3.0.1"

DefaultExtPort = 80
DefaultPort = 5000
Expand Down
12 changes: 6 additions & 6 deletions model/restful/utils/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ def run_task(service_name, service_endpoint):
response = concatenate_response_simple(response, nw_response)

# CPU task
if ("cpu_complexity" in service_endpoint) and len(service_endpoint["cpu_complexity"]["execution_time"]) > 0:
if ("cpu_complexity" in service_endpoint) and service_endpoint["cpu_complexity"]["execution_time"] > 0:
cpu_response, _ = execute_cpu_bounded_task(conf=service_endpoint["cpu_complexity"])
response["cpu_task"]["services"].append(source_svc["service"]+"/"+source_svc["endpoint"])
response["cpu_task"]["statuses"].append(cpu_response)

# Memory task
if ("memory_complexity" in service_endpoint) and len(service_endpoint["memory_complexity"]["execution_time"]) > 0:
mem_response, _ = execute_memory_bounded_task(conf=service_endpoint["memory_complexity"])
response["memory_task"]["services"].append(source_svc["service"]+"/"+source_svc["endpoint"])
response["memory_task"]["statuses"].append(mem_response)
# if ("memory_complexity" in service_endpoint) and len(service_endpoint["memory_complexity"]["execution_time"]) > 0:
# mem_response, _ = execute_memory_bounded_task(conf=service_endpoint["memory_complexity"])
# response["memory_task"]["services"].append(source_svc["service"]+"/"+source_svc["endpoint"])
# response["memory_task"]["statuses"].append(mem_response)

else: # "parallel"
executor = ThreadPoolExecutor(max_workers=3)
Expand All @@ -84,7 +84,7 @@ def run_task(service_name, service_endpoint):
task_futures.append(nw_future)

# CPU task
if ("cpu_complexity" in service_endpoint) and len(service_endpoint["cpu_complexity"]["execution_time"]) > 0:
if ("cpu_complexity" in service_endpoint) and service_endpoint["cpu_complexity"]["execution_time"] > 0:
cpu_future = executor.submit(execute_cpu_bounded_task, service_endpoint["cpu_complexity"])
task_futures.append(cpu_future)

Expand Down

0 comments on commit 5eac982

Please sign in to comment.