Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Periodically Send Demo Traffic #46

Merged
merged 21 commits into from
Apr 12, 2023
Merged

Periodically Send Demo Traffic #46

merged 21 commits into from
Apr 12, 2023

Conversation

versilis
Copy link
Member

  • Add demo server stubs
  • Add demo-server to docker-compose.yaml
  • Fix priority of stubs
  • go mod tidy
  • Update agent config model to contain a demo field
  • Add provider for the demo server client
  • Add methods to send demo server traffic
  • Add repo method to send mock traffic
  • Add interactor for sending of demo traffic
  • Send demo traffic periodically in the background

@versilis versilis requested a review from jombooth April 11, 2023 17:56
@versilis versilis self-assigned this Apr 11, 2023
Copy link
Contributor

@jombooth jombooth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this is still draft, but since I'm assigned as reviewer, I figured I'd post some initial comments :) LMK if you'd like a final approval as well!

vm/infrastructure/datasource/demo-server.go Outdated Show resolved Hide resolved
vm/infrastructure/repo/demo.go Show resolved Hide resolved
Comment on lines 21 to 34
err := d.demoServer.GetBreed()
if err != nil {
glog.Errorf("failed to send breed request: %v", err)
}

err = d.demoServer.PostTrick()
if err != nil {
glog.Errorf("failed to send trick request: %v", err)
}

err = d.demoServer.GetBreed()
if err != nil {
glog.Errorf("failed to send breed request: %v", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling GetBreed twice and PostTrick once feels a bit arbitrary to me. Any reason not to send one of each, or uniform-randomly pick one of the supported requests to perform on each call?

Copy link
Member Author

@versilis versilis Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that it would be nice to see the difference in request counts between the two endpoints.

I don't feel too strongly about this implementation, so I'll leave the conversation open if you think it's worth either picking an API randomly or just sending one of each.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection, would only suggest that a comment might help dissuade future readers from wondering the same thing as I did! Another option would be to randomize the calls so that 33% are PostTrick and 67% are GetBreed :)

vm/main.go Outdated Show resolved Hide resolved
vm/main.go Outdated Show resolved Hide resolved
demo-server/mappings/stubs.json Outdated Show resolved Hide resolved
@versilis versilis marked this pull request as ready for review April 11, 2023 21:51
@versilis versilis requested a review from jombooth April 11, 2023 22:15
@versilis versilis mentioned this pull request Apr 11, 2023
Copy link
Contributor

@jombooth jombooth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

vm/main.go Outdated Show resolved Hide resolved
Comment on lines 21 to 34
err := d.demoServer.GetBreed()
if err != nil {
glog.Errorf("failed to send breed request: %v", err)
}

err = d.demoServer.PostTrick()
if err != nil {
glog.Errorf("failed to send trick request: %v", err)
}

err = d.demoServer.GetBreed()
if err != nil {
glog.Errorf("failed to send breed request: %v", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection, would only suggest that a comment might help dissuade future readers from wondering the same thing as I did! Another option would be to randomize the calls so that 33% are PostTrick and 67% are GetBreed :)

versilis and others added 2 commits April 11, 2023 19:17
Update comments based on suggestions

Fix bug
This adds a toggle-able demo to the Docker Extension UI. When "Demo
Mode" is toggled, Akita will send stub requests to a mock server which
will be used by the agent for traffic collection.


https://user-images.githubusercontent.com/100976287/231302994-34d4fb0a-5e57-4974-8b64-5a37115ea7dc.mov


Depends on: #46
@versilis versilis merged commit 1322604 into main Apr 12, 2023
@versilis versilis deleted the versilis/demo branch April 12, 2023 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants