Skip to content

Commit

Permalink
update new files
Browse files Browse the repository at this point in the history
  • Loading branch information
vordimous committed Mar 1, 2024
1 parent d6fcbc3 commit 1d812ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 103 deletions.
101 changes: 0 additions & 101 deletions extras-containers/taxi/grpc/service/default_routes_load_test.json

This file was deleted.

9 changes: 7 additions & 2 deletions extras-containers/taxi/grpc/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var (
brokerPort = env.GetIntDefault("BROKER_PORT", 7183)
printSim = env.GetBoolDefault("PRINT_SIM_LOGS", false)
defaultRoutes = env.GetBoolDefault("DEFAUlT_ROUTES", false)
replication = env.GetIntDefault("REPLICATION", 1)
logChannel = make(chan string)
)

Expand All @@ -36,6 +37,8 @@ type dataConfig struct {

type topicConfig struct {
Type string `json:"TYPE"`
RangeStart int `json:"RANGE_START"`
RangeEnd int `json:"RANGE_END"`
Prefix string `json:"PREFIX"`
TimeInterval int `json:"TIME_INTERVAL"`
Data []dataConfig `json:"DATA"`
Expand Down Expand Up @@ -127,7 +130,7 @@ func (s *taxiRouteServer) CreateTaxi(ctx context.Context, in *pb.Route) (*pb.Rou
endMark = append(endMark, -1)
coords.Values = append(coords.Values, endMark)

routeKey := fmt.Sprintf("taxi/%s/location", in.GetKey())
routeKey := fmt.Sprintf("taxi/%s", in.GetKey())
simConfig := simulatorConfig{
BrokerURL: brokerURL,
BrokerPort: brokerPort,
Expand All @@ -136,7 +139,9 @@ func (s *taxiRouteServer) CreateTaxi(ctx context.Context, in *pb.Route) (*pb.Rou
Qos: 0,
Topics: []topicConfig{
{
Type: "single",
Type: "multiple",
RangeStart: 1,
RangeEnd: replication,
Prefix: routeKey,
TimeInterval: int(in.GetDuration() / float64(len(coords.Values))),
Data: []dataConfig{
Expand Down

0 comments on commit 1d812ec

Please sign in to comment.