Testing Toll SDK deployed on your AWS Cloud

Once you setup TollGuru Toll SDK, use the following guide for testing.

MapUp Team
TollGuru
6 min readOct 10, 2023

--

Testing TollGuru Toll SDK deployed on your AWS Cloud infrastructure

Introduction

This guide outlines steps to monitor and test your TollGuru SDK deployment within Kubernetes, ensuring your toll calculation service operates smoothly. We’ll check the pod and service status, then provide a manual testing process to confirm the successful deployment, and finally conduct load testing.

Set the Stage

Check that you have deployed your Kubernetes pods and services on AWS, using the steps detailed in Deploy TollGuru Toll SDK on Your AWS Cloud.

Monitor Pods

You can monitor the status of your Kubernetes pods to understand their health and functionality. Use the following command to continuously monitor and update the status of Kubernetes pods in the ‘tollguru’ namespace, refreshing every second.

watch -n 1 -t kubectl get pods -n tollguru

Monitor Services

Similarly, check the status of your Kubernetes services. Use the following command to retrieve a list of Kubernetes services in the ‘tollguru’ namespace, displaying information about their status, endpoints, and other relevant details.

kubectl get svc -n tollguru
Get load balancer

Use the highlighted URL as the BASE_URL

Step 1: Test the Deployed TollGuru SDK

Use this step to validate the functionality of the TollGuru SDK deployed on your infrastructure using the BASE_URL from TollGuru SDK setup.

Manual Testing

Use manual testing to identify potential issues like broken links, incorrect content, or unexpected behavior, ensuring that the URL delivers the intended user experience. You may use Postman or a similar API testing tool for this step.

Endpoint: Tolls for Road Geometry as a Path (a list of geo-coordinates)

  • URL: http://<BASE_URL>/polyline-map-matching
    Replace <BASE_URL> with the actual BASE_URL you documented earlier.
  • Method: POST
  • Sample request:
{
"mapProvider": "osm",
"path": "-38.11806,145.13713|-38.11772,145.13722|-38.11508,145.13739|-38.11427,145.13746|-38.11419,145.13746|-38.11335,145.13756|-38.11298,145.13766|-38.11263,145.13776|-38.11235,145.13786|-38.11224,145.13790|-38.11214,145.13793|-38.11174,145.13806|-38.11108,145.13828|-38.11051,145.13847|-38.10864,145.13907|-38.10814,145.13923|-38.10792,145.13930|-38.10710,145.13948|-38.10628,145.13962|-38.10593,145.13967|-38.10554,145.13972|-38.10501,145.13982|-38.10462,145.13990|-38.10448,145.13993|-38.10402,145.14006|-38.10365,145.14021|-38.10321,145.14039|-38.10285,145.14056|-38.10242,145.14081|-38.10192,145.14113|-38.10186,145.14117|-38.10066,145.14206|-38.10028,145.14234|-38.10028,145.14234|-38.10006,145.14253|-38.09941,145.14307|-38.09903,145.14343|-38.09864,145.14379|-38.09836,145.14404|-38.09813,145.14428|-38.09812,145.14429|-38.09789,145.14452|-38.09759,145.14484|-38.09712,145.14538|-38.09651,145.14614|-38.09636,145.14630|-38.09604,145.14672|-38.09586,145.14698|-38.09569,145.14721|-38.09564,145.14729|-38.09544,145.14757|-38.09474,145.14855|-38.09445,145.14897|-38.09419,145.14936|-38.09401,145.14964|-38.09384,145.14990|-38.09363,145.15024|-38.09354,145.15038|-38.09338,145.15064|-38.09323,145.15090|-38.09292,145.15140|-38.09280,145.15161|-38.09267,145.15182|-38.09237,145.15237|-38.09227,145.15253|-38.09221,145.15264|-38.09210,145.15284|-38.09130,145.15455|-38.09129,145.15457|-38.09121,145.15476|-38.09121,145.15477|-38.09089,145.15549|-38.09045,145.15659|-38.09003,145.15773|-38.08993,145.15804|-38.08975,145.15857|-38.08972,145.15867|-38.08968,145.15877|-38.08899,145.16086|-38.08813,145.16357|-38.08803,145.16386|-38.08696,145.16721|-38.08691,145.16738|-38.08678,145.16778|-38.08651,145.16864|-38.08619,145.16967|-38.08597,145.17036|-38.08568,145.17117|-38.08545,145.17175|-38.08514,145.17244|-38.08490,145.17292|-38.08472,145.17328|-38.08462,145.17347|-38.08430,145.17403|-38.08392,145.17463|-38.08386,145.17472|-38.08368,145.17497|-38.08366,145.17501|-38.08362,145.17506|-38.08338,145.17540|-38.08297,145.17593|-38.08247,145.17650|-38.08201,145.17698|-38.08162,145.17736|-38.08118,145.17775|-38.08059,145.17824|-38.08000,145.17866|-38.07937,145.17906|-38.07878,145.17939|-38.07867,145.17944|-38.07849,145.17953|-38.07839,145.17958|-38.07837,145.17958|-38.07816,145.17969|-38.07782,145.17984|-38.07748,145.17997|-38.07702,145.18013|-38.07634,145.18033|-38.07594,145.18042|-38.07523,145.18060|-38.07480,145.18070|-38.07471,145.18075|-38.07399,145.18093|-38.07396,145.18094|-38.07343,145.18109|-38.07297,145.18121|-38.07246,145.18134|-38.07181,145.18151|-38.07139,145.18161|-38.07070,145.18177|-38.07048,145.18181|-38.07027,145.18185|-38.07005,145.18189|-38.06882,145.18210|-38.06826,145.18218|-38.06615,145.18248|-38.06521,145.18262|-38.06411,145.18279|-38.06389,145.18283|-38.06269,145.18304|-38.06223,145.18312|-38.05997,145.18357|-38.05711,145.18412|-38.05566,145.18441|-38.05555,145.18443|-38.05520,145.18450|-38.05443,145.18465|-38.05417,145.18470|-38.05127,145.18527|-38.04840,145.18584|-38.04555,145.18639|-38.04529,145.18645|-38.04500,145.18650|-38.04259,145.18697|-38.04147,145.18723|-38.03972,145.18764|-38.03758,145.18830|-38.03726,145.18840|-38.03708,145.18846|-38.03691,145.18851|-38.03680,145.18855|-38.03651,145.18863|-38.03606,145.18877|-38.03592,145.18881|-38.03534,145.18899|-38.03529,145.18901|-38.03442,145.18923|-38.03326,145.18945|-38.03229,145.18960|-38.03099,145.18968|-38.03058,145.18970|-38.02998,145.18971|-38.02962,145.18970|-38.02944,145.18970|-38.02926,145.18969|-38.02915,145.18969|-38.02890,145.18966|-38.02811,145.18957|-38.02773,145.18952|-38.02752,145.18949|-38.02679,145.18937|-38.02593,145.18919|-38.02517,145.18900|-38.02516,145.18900|-38.02499,145.18894|-38.02463,145.18882|-38.02412,145.18866|-38.02349,145.18844|-38.02288,145.18820|-38.02176,145.18779|-38.02133,145.18767|-38.02091,145.18755|-38.02050,145.18748|-38.01936,145.18728|-38.01933,145.18728|-38.01916,145.18727|-38.01900,145.18725|-38.01868,145.18724|-38.01816,145.18721|-38.01777,145.18721|-38.01752,145.18721|-38.01737,145.18722|-38.01724,145.18723|-38.01705,145.18724|-38.01704,145.18724|-38.01696,145.18723|-38.01674,145.18724|-38.01668,145.18725|-38.01592,145.18734|-38.01578,145.18737|-38.01523,145.18747|-38.01427,145.18767|-38.01391,145.18773|-38.01373,145.18777|-38.01355,145.18780|-38.01349,145.18781|-38.01337,145.18784|-38.01143,145.18831|-38.01125,145.18834|-38.01053,145.18850|-38.01010,145.18862|-38.00855,145.18904|-38.00800,145.18920|-38.00626,145.18973|-38.00619,145.18975|-38.00611,145.18977|-38.00609,145.18979|-38.00574,145.18992|-38.00573,145.18992|-38.00564,145.18995|-38.00488,145.19020|-38.00407,145.19046|-38.00360,145.19062|-38.00307,145.19079|-38.00289,145.19085|-38.00216,145.19106|-38.00182,145.19114|-38.00177,145.19116|-38.00130,145.19127|-38.00110,145.19130|-38.00013,145.19143|-38.00010,145.19143|-37.99974,145.19146|-37.99950,145.19148|-37.99920,145.19150|-37.99912,145.19151|-37.99875,145.19151|-37.99866,145.19151|-37.99848,145.19152|-37.99803,145.19152|-37.99731,145.19151|-37.99506,145.19145|-37.99473,145.19144|-37.99368,145.19150|-37.99297,145.19159|-37.99284,145.19161|-37.99279,145.19162|-37.99271,145.19163|-37.99262,145.19164|-37.99252,145.19166|-37.99242,145.19167|-37.99193,145.19175|-37.99186,145.19176|-37.99152,145.19183|-37.99094,145.19195|-37.98883,145.19239|-37.98846,145.19247|-37.98811,145.19255|-37.98760,145.19266|-37.98715,145.19276|-37.98684,145.19282|-37.98659,145.19286|-37.98635,145.19289|-37.98613,145.19293|-37.98571,145.19296|-37.98540,145.19298|-37.98515,145.19299|-37.98494,145.19299|-37.98447,145.19298|-37.98389,145.19295|-37.98377,145.19293|-37.98342,145.19288|-37.98324,145.19286|-37.98306,145.19283|-37.98290,145.19281|-37.98287,145.19281|-37.98155,145.19265|-37.98147,145.19264|-37.98132,145.19263|-37.98110,145.19261|-37.98026,145.19259|-37.98015,145.19259|-37.97920,145.19263|-37.97902,145.19264|-37.97883,145.19265|-37.97862,145.19267|-37.97847,145.19269|-37.97837,145.19270|-37.97811,145.19274|-37.97808,145.19274|-37.97708,145.19292|-37.97578,145.19317|-37.97541,145.19325|-37.97535,145.19326",
"locTimes": [
[
0,
1690457712
],
[
4,
1690457942
],
[
99,
1690459205
]
],
"vehicle": {
"type": "2AxlesAuto"
},
"fuelOptions": {
"fuelCost": {
"value": 1.62,
"currency": "AUD",
"units": "$/liter"
},
"fuelEfficiency": {
"city": 13,
"hwy": 9.7,
"units": "L/100km"
}
}
}

Endpoint: Tolls for Polyline from a Mapping Service
Note: Use this endpoint if your map-matching pods are in a pending state.

  • URL: http://<BASE_URL>/complete-polyline-from-mapping-service
  • Method: POST
  • Sample request:
{
"mapProvider": "osm",
"path": "-33.94358,151.07367|-33.94357,151.07397|-33.94355,151.07418|-33.94353,151.07445|-33.94350,151.07470|-33.94348,151.07494|-33.94347,151.07504|-33.94344,151.07524|-33.94337,151.07581|-33.94328,151.07632|-33.94320,151.07673|-33.94317,151.07685|-33.94315,151.07696|-33.94312,151.07706|-33.94310,151.07716|-33.94306,151.07733|-33.94305,151.07737|-33.94300,151.07759|-33.94295,151.07779|-33.94287,151.07808|-33.94283,151.07820|-33.94269,151.07868|-33.94251,151.07920|-33.94239,151.07952|-33.94225,151.07987|-33.94221,151.07998|-33.94214,151.08013|-33.94201,151.08045|-33.94183,151.08091|-33.94161,151.08139|-33.94150,151.08164|-33.94138,151.08194|-33.94122,151.08235|-33.94087,151.08314|-33.94077,151.08337|-33.94069,151.08355|-33.94069,151.08355|-33.94066,151.08372|-33.94059,151.08390|-33.94054,151.08404|-33.94047,151.08421|-33.94039,151.08446|-33.94033,151.08466|-33.94024,151.08497|-33.94016,151.08538|-33.94006,151.08592|-33.94002,151.08634|-33.93999,151.08668|-33.93996,151.08707|-33.93997,151.08754|-33.94000,151.08796|-33.94007,151.08898|-33.94013,151.08951|-33.94024,151.09107|-33.94024,151.09114|-33.94026,151.09234|-33.94017,151.09352|-33.94014,151.09373|-33.94001,151.09480|-33.93988,151.09570|-33.93974,151.09656|-33.93955,151.09744|-33.93943,151.09795|-33.93932,151.09832|-33.93924,151.09862|-33.93902,151.09936|-33.93897,151.09950|-33.93868,151.10026|-33.93856,151.10055|-33.93845,151.10083|-33.93828,151.10122|-33.93805,151.10174|-33.93799,151.10187|-33.93785,151.10215|-33.93778,151.10229|-33.93753,151.10281|-33.93749,151.10291|-33.93749,151.10291|-33.93729,151.10333|-33.93707,151.10384|-33.93706,151.10385|-33.93697,151.10410|-33.93688,151.10436|-33.93687,151.10438|-33.93685,151.10446|-33.93680,151.10464|-33.93674,151.10488|-33.93670,151.10502|-33.93666,151.10518|-33.93662,151.10535|-33.93657,151.10559|-33.93657,151.10561|-33.93651,151.10591|-33.93647,151.10613|-33.93644,151.10631|-33.93641,151.10653|-33.93626,151.10782|-33.93616,151.10878|-33.93610,151.10935|-33.93608,151.10947|-33.93601,151.11013|-33.93600,151.11025|-33.93594,151.11084|-33.93591,151.11117|-33.93591,151.11121|-33.93588,151.11180|-33.93586,151.11242|-33.93586,151.11248|-33.93586,151.11254|-33.93586,151.11286|-33.93586,151.11312|-33.93586,151.11324|-33.93587,151.11334|-33.93587,151.11337|-33.93587,151.11350|-33.93587,151.11356|-33.93588,151.11369|-33.93588,151.11375|-33.93589,151.11394|-33.93589,151.11407|-33.93591,151.11445|-33.93591,151.11447|-33.93592,151.11464|-33.93593,151.11471|-33.93594,151.11496|-33.93597,151.11528|-33.93598,151.11550|-33.93599,151.11560|-33.93600,151.11572|-33.93601,151.11580|-33.93601,151.11584|-33.93602,151.11593|-33.93602,151.11598|-33.93603,151.11611|-33.93604,151.11615|-33.93605,151.11637|-33.93606,151.11649|-33.93610,151.11699|-33.93611,151.11701|-33.93611,151.11712|-33.93612,151.11723|-33.93614,151.11744|-33.93615,151.11750|-33.93615,151.11761|-33.93615,151.11762|-33.93616,151.11766|-33.93617,151.11776|-33.93618,151.11788|-33.93619,151.11801|-33.93620,151.11819|-33.93621,151.11831|-33.93623,151.11852|-33.93623,151.11858|-33.93624,151.11874|-33.93626,151.11896|-33.93629,151.11939|-33.93630,151.11960|-33.93632,151.11982|-33.93634,151.12004|-33.93634,151.12005|-33.93639,151.12090|-33.93640,151.12096|-33.93649,151.12211|-33.93653,151.12263|-33.93658,151.12327|-33.93659,151.12335|-33.93659,151.12349|-33.93659,151.12371|-33.93660,151.12392|-33.93660,151.12414|-33.93661,151.12442|-33.93660,151.12470|-33.93660,151.12522|-33.93660,151.12534|-33.93656,151.12623|-33.93652,151.12652|-33.93649,151.12680|-33.93639,151.12753|-33.93628,151.12815|-33.93607,151.12914|-33.93595,151.12970|-33.93590,151.12990|-33.93586,151.13011|-33.93576,151.13053|-33.93559,151.13132|-33.93530,151.13262|-33.93508,151.13368|-33.93504,151.13389|-33.93498,151.13425|-33.93492,151.13466|-33.93486,151.13510|-33.93485,151.13517|-33.93478,151.13574|-33.93472,151.13637|-33.93469,151.13688|-33.93469,151.13689|-33.93467,151.13725|-33.93466,151.13733|-33.93466,151.13745|-33.93464,151.13790|-33.93464,151.13866|-33.93466,151.13949|-33.93467,151.13968|-33.93467,151.13971|-33.93469,151.14013|-33.93472,151.14043|-33.93473,151.14060|-33.93474,151.14063|-33.93476,151.14098|-33.93477,151.14102|-33.93477,151.14103|-33.93478,151.14116|-33.93481,151.14144|-33.93482,151.14151|-33.93492,151.14231|-33.93502,151.14310|-33.93503,151.14315|-33.93505,151.14331|-33.93509,151.14356|-33.93510,151.14367|-33.93524,151.14461|-33.93529,151.14492|-33.93537,151.14543|-33.93540,151.14565|-33.93544,151.14592|-33.93548,151.14618|-33.93550,151.14637|-33.93558,151.14687|-33.93564,151.14731|-33.93568,151.14756|-33.93568,151.14757|-33.93570,151.14770|-33.93573,151.14788|-33.93573,151.14794|-33.93574,151.14799|-33.93576,151.14811|-33.93576,151.14813|-33.93578,151.14821|-33.93579,151.14832|-33.93586,151.14868|-33.93592,151.14903|-33.93602,151.14938|-33.93618,151.14992|-33.93670,151.15120|-33.93681,151.15148|-33.93689,151.15167|-33.93690,151.15170|-33.93695,151.15179|-33.93705,151.15198|-33.93716,151.15217|-33.93727,151.15236|-33.93738,151.15254|-33.93748,151.15271|-33.93749,151.15273|-33.93759,151.15288|-33.93762,151.15293|-33.93764,151.15296|-33.93766,151.15299|-33.93769,151.15303|-33.93773,151.15309|-33.93777,151.15315|-33.93785,151.15324|-33.93796,151.15338|-33.93803,151.15347|-33.93815,151.15360|-33.93826,151.15373|-33.93846,151.15394|-33.93849,151.15398|-33.93896,151.15450|-33.93901,151.15456|-33.93922,151.15478|-33.93929,151.15487|-33.93972,151.15534|-33.93981,151.15544|-33.93986,151.15549|-33.93991,151.15554|-33.94094,151.15670|-33.94100,151.15678|-33.94105,151.15684|-33.94109,151.15690|-33.94112,151.15693|-33.94119,151.15702|-33.94122,151.15706|-33.94136,151.15725|-33.94141,151.15731|-33.94151,151.15745|-33.94166,151.15767|-33.94178,151.15787|-33.94191,151.15809|-33.94214,151.15849|-33.94269,151.15947|-33.94272,151.15952|-33.94275,151.15957|-33.94278,151.15962|-33.94293,151.15988|-33.94297,151.15994|-33.94303,151.16005|-33.94315,151.16026|-33.94324,151.16041|-33.94344,151.16076|-33.94345,151.16077|-33.94376,151.16131|-33.94386,151.16148|-33.94387,151.16150|-33.94391,151.16157|-33.94396,151.16165|-33.94400,151.16173|-33.94407,151.16184|-33.94428,151.16220|-33.94431,151.16226|-33.94468,151.16289|-33.94474,151.16300|-33.94495,151.16337|-33.94499,151.16344|-33.94511,151.16365|-33.94528,151.16398|-33.94549,151.16439|-33.94572,151.16486|-33.94588,151.16518|-33.94590,151.16523|-33.94601,151.16544|-33.94607,151.16556|-33.94616,151.16576|-33.94621,151.16587|-33.94627,151.16601|-33.94636,151.16625|-33.94643,151.16649|-33.94648,151.16671|-33.94651,151.16683|-33.94654,151.16695|-33.94656,151.16713|-33.94658,151.16732|-33.94660,151.16744|-33.94660,151.16758|-33.94661,151.16762|-33.94662,151.16782|-33.94662,151.16796|-33.94662,151.16809|-33.94662,151.16816|-33.94661,151.16823|-33.94660,151.16836|-33.94657,151.16862|-33.94656,151.16874|-33.94653,151.16889|-33.94651,151.16902|-33.94645,151.16927|-33.94636,151.16969|-33.94626,151.17020|-33.94618,151.17059|-33.94615,151.17074|-33.94613,151.17082|-33.94611,151.17095|-33.94610,151.17097|-33.94607,151.17116|-33.94606,151.17127|-33.94605,151.17130|-33.94604,151.17143|-33.94602,151.17154|-33.94601,151.17169|-33.94599,151.17192|-33.94598,151.17209|-33.94598,151.17223|-33.94597,151.17249|-33.94597,151.17249|-33.94596,151.17285|-33.94595,151.17347|-33.94594,151.17395",
"locTimes": [
[
0,
1690429844
],
[
35,
1690429930
],
[
76,
1690430276
]
],
"vehicle": {
"type": "2AxlesAuto"
},
"fuelOptions": {
"fuelCost": {
"value": 3.85,
"currency": "USD",
"units": "$/gallon"
},
"fuelEfficiency": {
"city": 23.4,
"hwy": 30,
"units": "MPG"
}
}
}

Step 2: Load Testing TollGuru SDK on your AWS

Before rolling out in production, conduct load testing to ensure the system handles incoming traffic and workloads efficiently. Use load testing to confirm that it maintains top performance even under high demand or resource constraints.

Load Testing

  • Monitor Horizontal Pod Autoscaler (HPA) for SDK: Use the following command to keep a watchful eye on the HPA for the TollGuru SDK, ensuring it dynamically scales in response to load.
kubectl get hpa tollguru-sdk-hpa -w -n tollguru
Monitor server load
  • Execute Load Tests:
    Note: Modify the URL in the curl-command.txt file with your BASE_URL before initiating the tests.

Navigate to the 03-testing-load directory and execute the load-testing script using the modified curl-command.txt.

cd 03-testing-load
./run-requests.sh curl-command.txt
  • Monitor HPA for Map Matching USA-01: Monitor the HPA for the TollGuru Map Matching USA-01, ensuring it adeptly scales under varying load conditions.
kubectl get hpa tollguru-map-matching-usa-01-hpa -w -n tollguru
Available pods with their CPU utilization

--

--