Skip to content

Latest commit

 

History

History
196 lines (126 loc) · 6.96 KB

custom_ghr_readme.md

File metadata and controls

196 lines (126 loc) · 6.96 KB

GHZ Custom

A repository for managing and making gRPC calls using the ghz tool.

Table of Contents

Getting Started

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have git installed.
  • You have chmod and sudo permissions.

Installation

To clone the repository, run:

git clone https://github.boschdevcloud.com/SAI1RNG/ghz-custom.git -b feature/main

Starting the Database

cd ghz-custom/cmd/ghz-web
chmod +x ./ghz-web
sudo ./ghz-web

Making gRPC Calls

cd ghz-custom/cmd/ghz
chmod +x ./ghz

Publish Call

./ghz --insecure --config=config.json

Subscribe Call

./ghz --insecure --config=config_subscribe.json json

Publish Call (with Database)

./ghz --insecure --config=config.json -O json | http POST localhost:80/api/ingest

Subscribe Call (with Database)

./ghz --insecure --config=config_subscribe.json json | http POST localhost:80/api/ingest

Sample Config-files Structure

  1. timeout: The amount of time the ghz is required to subscribe to kuksa-databroker {{.RequestNumber}} placeholder.
  2. request_id: This acts as a identifier to differntiate between multiple tests conducted. Example: 50sub300pub indicates an experiment with 50 subscribers and 300 publish calls, request_id can be anything helping identify between tests.
  3. description: Provides additional information about the request. Uses the {{.RequestNumber}} placeholder.
  4. fields: An array specifying data fields to be kept track of, such as ["2", "12"], here having "12" is a must.
Publish Config
Subscribe Config

Note: The combination of request_id and description forms a unique id for identifying a particular publish call in a given test.

Metadata used to monitor latency

kuksa_set_subscribe_postman

  • latency related metadata for publish call is recieved in the metadata of Http respone.
  • latency related metadata for subscribe call is received within the payload of the subscription response.

Pictorial representation of end to end latency calculation

metadata_capture

building ghz for arm64 architecture

use below docker command and inject the custom-ghz repo as a volume inside the golang docker container

docker run -it -v $PWD:/go/work golang:1.20-alpine

traverse to the cmd/ghz folder and execute below command

go build .

building ghz-web for arm64 architecture

docker run -it -v $PWD:/go/work golang:1.20

use Docker container for building ghz-web as it requires several dependencies

from the root folder (/go/work/ghz-custom) execute the below command

apt-get install libc6

CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -x -buildvcs=false -a -ldflags="-extldflags '-static' -s -w -X 'main.version=$(git rev-parse --abbrev-ref HEAD)' -X 'main.commit=$(git rev-parse HEAD)' -X 'main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)'" -o ./dist/ghz-web-custom-arm ./cmd/ghz-web/...

Commands used for testing on L4S testbed

structure of L4S testbed

image

nuc2rng (acting as a vehicle computer)

Starting ghz-web to collect monitoring data at (/home/nuc2rng/kuksa/likhith-kuksa-l4s/ghz-custom/cmd/ghz-web)

sudo ./ghz-web -config config.yaml

config.yaml content

server:
 port: 9999

starting KUKSA databroker

starting KUKSA at location: /home/nuc2rng/kuksa/likhith-kuksa-l4s/kuksa-databroker

docker compose up kuksa-databroker

pi2rng acting as a publisher

starting ghz in location : /home/pi2rng/kuksa/ghz-custom/cmd/ghz

./ghz --insecure --config=config.json -O json | http POST 192.168.10.20:9999/api/ingest

pi3rng acting as a subscriber

starting ghz in location : /home/pi3rng/kuksa/ghz-custom/cmd/ghz

./ghz --insecure --config=config_subscribe.json -O json | http POST 192.168.10.20:9999/api/ingest

generation of latency report from the ghz.db (containing monitoring info) in the nuc2rng folder

merging dbs from both pub and sub machines

execute following shell script from /home/nuc2rng/kuksa/likhith-kuksa-l4s/ghz-custom/cmd/ghz-web folder : /home/nuc2rng/kuksa/likhith-kuksa-l4s/ghz-custom/cmd/ghz-web/copy-ghz-dbs-from-clients.sh

scp [email protected]:///home/pi3rng/kuksa/ghz-custom/cmd/ghz-web/data/ghz.db ./data/ghz-subscriber-info.db
scp [email protected]:///home/pi2rng/kuksa/ghz-custom/cmd/ghz-web/data/ghz.db ./data/ghz-publisher-info.db

execute below command to do merging

sudo docker run -v $PWD:/work --entrypoint "/usr/local/bin/python3" rekocd/python-pandas:3.12.0 /work/db_merger.py /work/data/ghz-subscriber-info.db /work/data/ghz-publisher-info.db /work/data/ghz.db

execute below command to do data extraction

sudo docker run -v $PWD:/work --entrypoint "/usr/local/bin/python3" rekocd/python-pandas:3.12.0 "/work/sqlite-latency-extractor_XLS.py"

copy report locally

scp [email protected]:///home/nuc2rng/kuksa/likhith-kuksa-l4s/ghz-custom/cmd/ghz-web/latency_and_mean_stats.xlsx .

graph generator

execute below command to do graph generator in "ghz-web" folder

sudo docker run -v $PWD:/work --entrypoint "/usr/local/bin/python3" rekocd/python-pandas:3.12.0 "/work/graph-generator-multiple-files.py"