Skip to content

feat: hook into published subscribe values #428

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

Merged
merged 9 commits into from
Jul 22, 2021
Merged

Conversation

n1ru4l
Copy link
Collaborator

@n1ru4l n1ru4l commented Jul 16, 2021

A new take on #211 (which became too conflicted and huge). This PR only focuses on subscribe.

@vercel
Copy link

vercel bot commented Jul 16, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/theguild/envelop/8JPQ5R6xagZKxkW1uHMLFVo3VLz2
✅ Preview: https://envelop-git-subscribe-hooks-theguild.vercel.app

@changeset-bot
Copy link

changeset-bot bot commented Jul 16, 2021

🦋 Changeset detected

Latest commit: ef17455

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@envelop/core Minor
@envelop/types Minor
@envelop/execute-subscription-event Patch
@envelop/operation-field-permissions Patch
@envelop/prometheus Major
@envelop/fragment-arguments Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@theguild-bot
Copy link
Collaborator

theguild-bot commented Jul 16, 2021

The latest changes of this PR are available as alpha in npm (based on the declared changesets):

@envelop/core@0.6.0-alpha-211c365.0
@envelop/execute-subscription-event@0.0.1-alpha-211c365.0
@envelop/fragment-arguments@0.0.7-alpha-211c365.0
@envelop/operation-field-permissions@0.0.7-alpha-211c365.0
@envelop/prometheus@1.0.0-alpha-211c365.0
@envelop/types@0.5.0-alpha-211c365.0

@theguild-bot
Copy link
Collaborator

theguild-bot commented Jul 16, 2021

✅ Benchmark Results

     ✓ no_errors
     ✓ expected_result

     checks.............................................: 100.00% ✓ 114314     ✗ 0    
     data_received......................................: 440 MB  8.8 MB/s
     data_sent..........................................: 25 MB   499 kB/s
     envelop_init.......................................: avg=2.22µs   min=500ns    med=1.2µs    max=5.14ms   p(90)=3.4µs    p(95)=4.2µs   
     ✓ { mode:envelop-cache-jit }.......................: avg=1.41µs   min=500ns    med=1µs      max=5.14ms   p(90)=1.4µs    p(95)=1.6µs   
     ✓ { mode:envelop-just-cache }......................: avg=1.34µs   min=500ns    med=1.2µs    max=593.8µs  p(90)=1.7µs    p(95)=1.9µs   
     ✓ { mode:graphql-js }..............................: avg=3.25µs   min=700ns    med=2.9µs    max=1.64ms   p(90)=3.99µs   p(95)=4.39µs  
     ✓ { mode:prom-tracing }............................: avg=7.04µs   min=2.29µs   med=3.7µs    max=1.02ms   p(90)=11.3µs   p(95)=12µs    
     envelop_total......................................: avg=419.57µs min=0s       med=193.59µs max=21.87ms  p(90)=775.71µs p(95)=1.89ms  
     ✓ { mode:envelop-cache-jit }.......................: avg=194µs    min=114.69µs med=173.59µs max=13.25ms  p(90)=223.29µs p(95)=251.19µs
     ✓ { mode:envelop-just-cache }......................: avg=492.85µs min=307.59µs med=422.49µs max=12.51ms  p(90)=547.39µs p(95)=811.4µs 
     ✓ { mode:graphql-js }..............................: avg=740.66µs min=434.19µs med=595.89µs max=21.87ms  p(90)=821.76µs p(95)=1.37ms  
     ✓ { mode:prom-tracing }............................: avg=2.14ms   min=1.44ms   med=1.98ms   max=13.77ms  p(90)=2.78ms   p(95)=3.34ms  
     graphql_context....................................: avg=4.91µs   min=2.1µs    med=3.4µs    max=8.05ms   p(90)=8.1µs    p(95)=10.2µs  
     ✓ { mode:envelop-cache-jit }.......................: avg=3.51µs   min=2.1µs    med=3.09µs   max=1.3ms    p(90)=3.7µs    p(95)=3.9µs   
     ✓ { mode:envelop-just-cache }......................: avg=3.88µs   min=2.4µs    med=3.4µs    max=1.22ms   p(90)=4µs      p(95)=4.4µs   
     ✓ { mode:graphql-js }..............................: avg=7.17µs   min=2.6µs    med=4.7µs    max=8.05ms   p(90)=9.29µs   p(95)=10.4µs  
     ✓ { mode:prom-tracing }............................: avg=10.84µs  min=6.39µs   med=9.19µs   max=1.42ms   p(90)=12.29µs  p(95)=16.8µs  
     graphql_execute....................................: avg=459.32µs min=77µs     med=325.39µs max=21.69ms  p(90)=1.46ms   p(95)=1.86ms  
     ✓ { mode:envelop-cache-jit }.......................: avg=140.24µs min=77µs     med=124.39µs max=13.19ms  p(90)=163.59µs p(95)=185.84µs
     ✓ { mode:envelop-just-cache }......................: avg=436.04µs min=272.19µs med=370.79µs max=12.47ms  p(90)=479.08µs p(95)=661.94µs
     ✓ { mode:graphql-js }..............................: avg=486.78µs min=288.29µs med=380.39µs max=21.69ms  p(90)=514.19µs p(95)=956.32µs
     ✓ { mode:prom-tracing }............................: avg=2.01ms   min=1.36ms   med=1.85ms   max=13.35ms  p(90)=2.58ms   p(95)=3.2ms   
     graphql_parse......................................: avg=15.92µs  min=3.6µs    med=6.6µs    max=16.02ms  p(90)=39.3µs   p(95)=51.39µs 
     ✓ { mode:envelop-cache-jit }.......................: avg=8.42µs   min=4µs      med=6.5µs    max=10.21ms  p(90)=9.29µs   p(95)=10.9µs  
     ✓ { mode:envelop-just-cache }......................: avg=7.51µs   min=3.6µs    med=5µs      max=5.3ms    p(90)=13.69µs  p(95)=15.5µs  
     ✓ { mode:graphql-js }..............................: avg=27.49µs  min=9.5µs    med=16.5µs   max=16.02ms  p(90)=33.99µs  p(95)=41.43µs 
     ✓ { mode:prom-tracing }............................: avg=57.45µs  min=34.39µs  med=50.49µs  max=1.73ms   p(90)=74.69µs  p(95)=89.05µs 
     graphql_validate...................................: avg=71.56µs  min=26.3µs   med=37.39µs  max=16.14ms  p(90)=168.09µs p(95)=202.39µs
     ✓ { mode:envelop-cache-jit }.......................: avg=40.41µs  min=26.3µs   med=34.89µs  max=6.04ms   p(90)=51.29µs  p(95)=56.59µs 
     ✓ { mode:envelop-just-cache }......................: avg=44.07µs  min=26.39µs  med=35.5µs   max=4.4ms    p(90)=53.6µs   p(95)=64.3µs  
     ✓ { mode:graphql-js }..............................: avg=215.95µs min=125.89µs med=176.39µs max=16.14ms  p(90)=247.89µs p(95)=290.23µs
     ✓ { mode:prom-tracing }............................: avg=56.22µs  min=35.4µs   med=49.29µs  max=2.09ms   p(90)=69.4µs   p(95)=80.05µs 
     http_req_blocked...................................: avg=5.68µs   min=1.1µs    med=2.1µs    max=13.06ms  p(90)=2.9µs    p(95)=4.4µs   
     http_req_connecting................................: avg=1.54µs   min=0s       med=0s       max=11.5ms   p(90)=0s       p(95)=0s      
     http_req_duration..................................: avg=8.16ms   min=374.99µs med=5.79ms   max=99.87ms  p(90)=17.88ms  p(95)=21.62ms 
       { expected_response:true }.......................: avg=8.16ms   min=374.99µs med=5.79ms   max=99.87ms  p(90)=17.88ms  p(95)=21.62ms 
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: avg=6.71ms   min=760.49µs med=5.5ms    max=46.38ms  p(90)=11.23ms  p(95)=13.15ms 
     ✓ { mode:envelop-cache-jit }.......................: avg=4.41ms   min=374.99µs med=3.3ms    max=35.41ms  p(90)=9.9ms    p(95)=12.63ms 
     ✓ { mode:envelop-just-cache }......................: avg=7.49ms   min=649.4µs  med=6.17ms   max=48.76ms  p(90)=12.49ms  p(95)=15.05ms 
     ✓ { mode:graphql-js }..............................: avg=13.66ms  min=1.01ms   med=12.76ms  max=74.05ms  p(90)=21.12ms  p(95)=26.3ms  
     ✓ { mode:prom-tracing }............................: avg=23.72ms  min=3.83ms   med=21.22ms  max=99.87ms  p(90)=38.32ms  p(95)=43.63ms 
     http_req_failed....................................: 0.00%   ✓ 0          ✗ 57157
     http_req_receiving.................................: avg=74.01µs  min=15.59µs  med=32.8µs   max=34.2ms   p(90)=54.2µs   p(95)=79.19µs 
     http_req_sending...................................: avg=75.51µs  min=7.2µs    med=12.9µs   max=23.54ms  p(90)=33.09µs  p(95)=47.21µs 
     http_req_tls_handshaking...........................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...................................: avg=8.02ms   min=338.99µs med=5.69ms   max=99.8ms   p(90)=17.63ms  p(95)=21.46ms 
     http_reqs..........................................: 57157   1142.72056/s
     iteration_duration.................................: avg=8.74ms   min=631.69µs med=6.31ms   max=100.33ms p(90)=18.62ms  p(95)=22.28ms 
     iterations.........................................: 57157   1142.72056/s
     vus................................................: 10      min=10       max=11 
     vus_max............................................: 40      min=40       max=40 

@dotansimha
Copy link
Member

@n1ru4l merged all sub-PRs into this one, still need to review it all together :)

@dotansimha dotansimha merged commit dbb241d into main Jul 22, 2021
@dotansimha dotansimha deleted the subscribe-hooks branch July 22, 2021 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants