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

Hey sample function #1489

Merged
merged 2 commits into from Mar 29, 2020
Merged

Hey sample function #1489

merged 2 commits into from Mar 29, 2020

Conversation

kylos101
Copy link
Contributor

Description

Add a sample hey function.

Motivation and Context

It is important to load test. Why not have a function to help do it?

  • I have raised an issue to propose this change, it is located here
  • My issue has received approval from the maintainers or lead with the design/approved label

How Has This Been Tested?

  1. I built the function on my local machine, and confirmed that subsequent builds were cached.
  2. I pushed the function to my personal Docker Hub.
  3. I deployed Nodeinfo and this temporary build of the hey function to my personnel OpenFaaS.
  4. I confirmed hey provides results like it does on the CLI.

Impact to other areas of code

N/A

Test environment details

  1. My cluster is running in Digital Ocean. I started using DO from a referral link from one of Alex's posts. I setup my cluster ark in about 15 minutes. I love ark.
  2. After running the steps above (1-4), I deleted both functions from my cluster.
  3. Screenshot of deployed function
    image
  4. Rresults

Summary:
  Total:	1.5234 secs
  Slowest:	1.5058 secs
  Fastest:	0.0027 secs
  Average:	0.1133 secs
  Requests/sec:	131.2876
  
  Total data:	20200 bytes
  Size/request:	101 bytes

Response time histogram:
  0.003 [1]	|
  0.153 [155]	|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  0.303 [34]	|■■■■■■■■■
  0.454 [2]	|■
  0.604 [1]	|
  0.754 [2]	|■
  0.905 [1]	|
  1.055 [1]	|
  1.205 [1]	|
  1.355 [1]	|
  1.506 [1]	|


Latency distribution:
  10% in 0.0057 secs
  25% in 0.0461 secs
  50% in 0.0582 secs
  75% in 0.1228 secs
  90% in 0.2117 secs
  95% in 0.3703 secs
  99% in 1.3049 secs

Details (average, fastest, slowest):
  DNS+dialup:	0.0240 secs, 0.0027 secs, 1.5058 secs
  DNS-lookup:	0.0024 secs, 0.0000 secs, 0.0118 secs
  req write:	0.0002 secs, 0.0000 secs, 0.0053 secs
  resp wait:	0.0883 secs, 0.0026 secs, 1.3968 secs
  resp read:	0.0001 secs, 0.0000 secs, 0.0003 secs

Status code distribution:
  [200]	200 responses

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Use it to do load testing and observe scaling.

Signed-off-by: Kyle Brennan <kylos101@gmail.com>
Simplified language and reduced long running lines.

Signed-off-by: Kyle Brennan <kylos101@gmail.com>
Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

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

Lgtm

@alexellis alexellis merged commit 28e53aa into openfaas:master Mar 29, 2020
@alexellis
Copy link
Member

Thank you for submitting your first pull request to OpenFaaS!

Please could you update the stack.yml file one level up too? That way I can run a build/push and we can get your store PR going.

@kylos101 kylos101 deleted the hey-sample-function branch March 29, 2020 19:34
@kylos101 kylos101 restored the hey-sample-function branch March 29, 2020 19:36
@kylos101
Copy link
Contributor Author

kylos101 commented Mar 29, 2020

Thank you for submitting your first pull request to OpenFaaS!

Please could you update the stack.yml file one level up too? That way I can run a build/push and we can get your store PR going.

Stack.yml is all set in #1498 . @alexellis , for the store PR, should I update templates.json, store.json, or both? I assume functions.json (cause its the most recent version, 0.2.0), but am just guessing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants