forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add traffic to adservice & recommendataion service (open-telemetry#379)
- Loading branch information
Showing
4 changed files
with
91 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,4 @@ src/frontend/cypress/videos | |
src/frontend/cypress/screenshots | ||
vendor/ | ||
composer.lock | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
|
||
from opentelemetry import context, baggage, trace | ||
from opentelemetry.sdk.trace import TracerProvider | ||
from opentelemetry.sdk.trace.export import (BatchSpanProcessor) | ||
from opentelemetry.sdk.trace.export import BatchSpanProcessor | ||
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter | ||
from opentelemetry.instrumentation.requests import RequestsInstrumentor | ||
from opentelemetry.instrumentation.urllib3 import URLLib3Instrumentor | ||
|
@@ -42,7 +42,7 @@ | |
"9SIQT8TOJO", | ||
"L9ECAV7KIM", | ||
"LS4PSXUNUM", | ||
"OLJCESPC7Z" | ||
"OLJCESPC7Z", | ||
] | ||
|
||
people = [ | ||
|
@@ -53,15 +53,15 @@ | |
"zipCode": 94043, | ||
"city": "Mountain View", | ||
"state": "CA", | ||
"country": "United States" | ||
"country": "United States", | ||
}, | ||
"userCurrency": "USD", | ||
"creditCard": { | ||
"creditCardNumber": "4432-8015-6152-0454", | ||
"creditCardExpirationMonth": 1, | ||
"creditCardExpirationYear": 2039, | ||
"creditCardCvv": 672 | ||
} | ||
"creditCardCvv": 672, | ||
}, | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
|
@@ -70,15 +70,15 @@ | |
"zipCode": 98052, | ||
"city": "Redmond", | ||
"state": "WA", | ||
"country": "United States" | ||
"country": "United States", | ||
}, | ||
"userCurrency": "USD", | ||
"creditCard": { | ||
"creditCardNumber": "4532-4211-7434-1278", | ||
"creditCardExpirationMonth": 2, | ||
"creditCardExpirationYear": 2039, | ||
"creditCardCvv": 114 | ||
} | ||
"creditCardCvv": 114, | ||
}, | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
|
@@ -87,15 +87,15 @@ | |
"zipCode": 95014, | ||
"city": "Cupertino", | ||
"state": "CA", | ||
"country": "United States" | ||
"country": "United States", | ||
}, | ||
"userCurrency": "USD", | ||
"creditCard": { | ||
"creditCardNumber": "4532-6178-2799-1951", | ||
"creditCardExpirationMonth": 3, | ||
"creditCardExpirationYear": 2039, | ||
"creditCardCvv": 239 | ||
} | ||
"creditCardCvv": 239, | ||
}, | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
|
@@ -104,15 +104,15 @@ | |
"zipCode": 94025, | ||
"city": "Menlo Park", | ||
"state": "CA", | ||
"country": "United States" | ||
"country": "United States", | ||
}, | ||
"userCurrency": "USD", | ||
"creditCard": { | ||
"creditCardNumber": "4539-1103-5661-7083", | ||
"creditCardExpirationMonth": 4, | ||
"creditCardExpirationYear": 2039, | ||
"creditCardCvv": 784 | ||
} | ||
"creditCardCvv": 784, | ||
}, | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
|
@@ -121,15 +121,15 @@ | |
"zipCode": 98109, | ||
"city": "Seattle", | ||
"state": "WA", | ||
"country": "United States" | ||
"country": "United States", | ||
}, | ||
"userCurrency": "USD", | ||
"creditCard": { | ||
"creditCardNumber": "4916-0816-6217-7968", | ||
"creditCardExpirationMonth": 5, | ||
"creditCardExpirationYear": 2039, | ||
"creditCardCvv": 397 | ||
} | ||
"creditCardCvv": 397, | ||
}, | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
|
@@ -138,15 +138,15 @@ | |
"zipCode": 95032, | ||
"city": "Los Gatos", | ||
"state": "CA", | ||
"country": "United States" | ||
"country": "United States", | ||
}, | ||
"userCurrency": "USD", | ||
"creditCard": { | ||
"creditCardNumber": "4929-5431-0337-5647", | ||
"creditCardExpirationMonth": 6, | ||
"creditCardExpirationYear": 2039, | ||
"creditCardCvv": 793 | ||
} | ||
"creditCardCvv": 793, | ||
}, | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
|
@@ -155,15 +155,15 @@ | |
"zipCode": 214, | ||
"city": "Ottawa", | ||
"state": "ON", | ||
"country": "Canada" | ||
"country": "Canada", | ||
}, | ||
"userCurrency": "CAD", | ||
"creditCard": { | ||
"creditCardNumber": "4763-1844-9699-8031", | ||
"creditCardExpirationMonth": 7, | ||
"creditCardExpirationYear": 2039, | ||
"creditCardCvv": 488 | ||
} | ||
"creditCardCvv": 488, | ||
}, | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
|
@@ -172,15 +172,15 @@ | |
"zipCode": 94103, | ||
"city": "San Francisco", | ||
"state": "CA", | ||
"country": "United States" | ||
"country": "United States", | ||
}, | ||
"userCurrency": "USD", | ||
"creditCard": { | ||
"creditCardNumber": "4929-6495-8333-3657", | ||
"creditCardExpirationMonth": 8, | ||
"creditCardExpirationYear": 2039, | ||
"creditCardCvv": 159 | ||
} | ||
"creditCardCvv": 159, | ||
}, | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
|
@@ -189,16 +189,16 @@ | |
"zipCode": 95054, | ||
"city": "Santa Clara", | ||
"state": "CA", | ||
"country": "United States" | ||
"country": "United States", | ||
}, | ||
"userCurrency": "USD", | ||
"creditCard": { | ||
"creditCardNumber": "4485-4803-8707-3547", | ||
"creditCardExpirationMonth": 9, | ||
"creditCardExpirationYear": 2039, | ||
"creditCardCvv": 682 | ||
} | ||
} | ||
"creditCardCvv": 682, | ||
}, | ||
}, | ||
] | ||
|
||
|
||
|
@@ -213,6 +213,22 @@ def index(self): | |
def browse_product(self): | ||
self.client.get("/api/products/" + random.choice(products)) | ||
|
||
@task(3) | ||
def get_recommendations(self): | ||
user = str(uuid.uuid1()) | ||
params = { | ||
"productIds": [random.choice(products)], | ||
"sessionId": user, | ||
} | ||
self.client.get("/api/recommendations/", params=params) | ||
|
||
@task(3) | ||
def get_ads(self): | ||
params = { | ||
"productIds": [random.choice(products)], | ||
} | ||
self.client.get("/api/data/", params=params) | ||
|
||
@task(3) | ||
def view_cart(self): | ||
self.client.get("/api/cart") | ||
|
@@ -226,9 +242,9 @@ def add_to_cart(self, user=""): | |
cart_item = { | ||
"item": { | ||
"productId": product, | ||
"quantity": random.choice([1, 2, 3, 4, 5, 10]) | ||
"quantity": random.choice([1, 2, 3, 4, 5, 10]), | ||
}, | ||
"userId": user | ||
"userId": user, | ||
} | ||
self.client.post("/api/cart", json=cart_item) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,49 @@ | ||
backoff==1.10.0 | ||
black==22.8.0 | ||
Brotli==1.0.9 | ||
certifi==2022.9.14 | ||
charset-normalizer==2.0.12 | ||
click==8.1.3 | ||
ConfigArgParse==1.5.3 | ||
Deprecated==1.2.13 | ||
Flask==2.2.2 | ||
Flask-BasicAuth==0.2.0 | ||
Flask-Cors==3.0.10 | ||
gevent==21.12.0 | ||
geventhttpclient==2.0.2 | ||
googleapis-common-protos==1.56.4 | ||
greenlet==1.1.3 | ||
grpcio==1.49.0 | ||
idna==3.4 | ||
importlib-metadata==4.12.0 | ||
itsdangerous==2.1.2 | ||
Jinja2==3.1.2 | ||
locust==2.6.1 | ||
MarkupSafe==2.1.1 | ||
msgpack==1.0.4 | ||
mypy-extensions==0.4.3 | ||
opentelemetry-api==1.9.1 | ||
opentelemetry-exporter-otlp-proto-grpc==1.9.1 | ||
opentelemetry-instrumentation==0.28b1 | ||
opentelemetry-instrumentation-requests==0.28b1 | ||
opentelemetry-instrumentation-urllib3==0.28b1 | ||
opentelemetry-proto==1.9.1 | ||
opentelemetry-sdk==1.9.1 | ||
opentelemetry-semantic-conventions==0.28b1 | ||
opentelemetry-util-http==0.28b1 | ||
pathspec==0.10.1 | ||
platformdirs==2.5.2 | ||
protobuf==4.21.6 | ||
psutil==5.9.2 | ||
pyzmq==24.0.0 | ||
requests==2.27.1 | ||
urllib3==1.26.8 | ||
roundrobin==0.0.4 | ||
six==1.16.0 | ||
tomli==2.0.1 | ||
typing_extensions==4.3.0 | ||
urllib3==1.26.8 | ||
Werkzeug==2.2.2 | ||
wrapt==1.14.1 | ||
zipp==3.8.1 | ||
zope.event==4.5.0 | ||
zope.interface==5.4.0 |