setup bench

This commit is contained in:
2025-02-28 20:34:47 +01:00
parent f4e29c18e5
commit 0209e6ca6b
7 changed files with 111 additions and 57 deletions

View File

@@ -1,12 +0,0 @@
package main
import (
)
func exec_task(arg string) string{
response := "" + arg
return response
}

24
project/tasks/double.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"encoding/json"
)
type Request struct {
Data int
Name string
}
func exec_task(arg string) string{
req := Request{}
json.Unmarshal([]byte(arg), &req)
// double the data field
req.Data = req.Data * 2
// return the json string
json, _ := json.Marshal(req)
return string(json)
}

View File

@@ -1,12 +0,0 @@
package main
import (
)
func exec_task(arg string) string{
response := "Ciao danano " + arg
return response
}

View File

@@ -1,47 +1,101 @@
project_name: Test
tasks:
- name: Data Stream test 1
- name: Data Stream double value
type: processor_nats
code: task1.go
code: double.go
targets:
- cloud
source_topic: test_source
dest_topic: test_destination
component_name: data_aggregation_test
source_topic: test_source_data
dest_topic: ttest_dest_data
component_name: data_double_test
version: 1.0.0
- name: Aiutatemi
type: producer_nats
code: danano.go
- name: Data Stream double value 2
type: processor_nats
code: double.go
targets:
- edge
source_topic: test
dest_topic: test_source
component_name: test_producer_help1
- cloud
source_topic: test_source_data
dest_topic: ttest_dest_data
component_name: data_double_test2
version: 1.0.0
- name: Aiutatemi
type: producer_nats
code: danano.go
- name: Data Stream double value 3
type: processor_nats
code: double.go
targets:
- edge
source_topic: test
dest_topic: test_source
component_name: test_producer_help2
- cloud
source_topic: test_source_data
dest_topic: ttest_dest_data
component_name: data_double_test3
version: 1.0.0
- name: Aiutatemi
type: producer_nats
code: danano.go
- name: Data Stream double value 4
type: processor_nats
code: double.go
targets:
- edge
source_topic: test
dest_topic: test_source
component_name: test_producer_help3
- cloud
source_topic: test_source_data
dest_topic: ttest_dest_data
component_name: data_double_test4
version: 1.0.0
- name: Aiutatemi
type: producer_nats
code: danano.go
- name: Data Stream double value 5
type: processor_nats
code: double.go
targets:
- edge
source_topic: test
dest_topic: test_source
component_name: test_producer_help4
- cloud
source_topic: test_source_data
dest_topic: ttest_dest_data
component_name: data_double_test5
version: 1.0.0
- name: Data Stream double value 11
type: processor_nats
code: double.go
targets:
- cloud
source_topic: test_source_data
dest_topic: ttest_dest_data
component_name: data_double_test11
version: 1.0.0
- name: Data Stream double value 12
type: processor_nats
code: double.go
targets:
- cloud
source_topic: test_source_data
dest_topic: ttest_dest_data
component_name: data_double_test12
version: 1.0.0
- name: Data Stream double value 13
type: processor_nats
code: double.go
targets:
- cloud
source_topic: test_source_data
dest_topic: ttest_dest_data
component_name: data_double_test13
version: 1.0.0
- name: Data Stream double value 14
type: processor_nats
code: double.go
targets:
- cloud
source_topic: test_source_data
dest_topic: ttest_dest_data
component_name: data_double_test14
version: 1.0.0
- name: Data Stream double value 15
type: processor_nats
code: double.go
targets:
- cloud
source_topic: test_source_data
dest_topic: ttest_dest_data
component_name: data_double_test15
version: 1.0.0