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

Context with metadata #16

Merged
merged 13 commits into from Apr 18, 2017
Merged

Context with metadata #16

merged 13 commits into from Apr 18, 2017

Conversation

icebob
Copy link
Member

@icebob icebob commented Apr 18, 2017

Add metadata to context.

ctx.meta = {
  user: 5
}

@icebob icebob added this to the 0.7.0 milestone Apr 18, 2017
@coveralls
Copy link

coveralls commented Apr 18, 2017

Coverage Status

Coverage increased (+0.007%) to 99.618% when pulling 5be1717 on context-meta into f631912 on master.

@benchmark-bot
Copy link

🏁 Benchmark results

📝 Moleculer common benchmarks

⚡ Suite: Local call

Test Master PR Diff %
broker.call (normal) 776,386 861,484 +85,098 Performance: +11%
broker.call (with params) 775,947 734,729 -41,218 Performance: -5%

⚡ Suite: Call with middlewares

Test Master PR Diff %
No middlewares 789,423 751,011 -38,413 Performance: -5%
5 middlewares 678,226 862,443 +184,216 Performance: +27%

⚡ Suite: Call with statistics & metrics

Test Master PR Diff %
No statistics 696,138 905,653 +209,514 Performance: +30%
With metrics 71,407 75,171 +3,764 Performance: +5%
With statistics 564,495 [SKIP] - Performance: Skip
With metrics & statistics 75,679 78,659 +2,979 Performance: +4%

⚡ Suite: Remote call with FakeTransporter

Test Master PR Diff %
Remote call echo.reply 27,835 20,275 -7,560 Performance: -27%
Master detailed results
{
  "name": "Moleculer common benchmarks",
  "suites": [
    {
      "name": "Local call",
      "tests": [
        {
          "name": "broker.call (normal)",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.000087792,
            "cycle": 0,
            "count": 3882000,
            "avg": 0.0000012880184935600208,
            "rps": 776386.3678975978,
            "percent": 0
          }
        },
        {
          "name": "broker.call (with params)",
          "stat": {
            "duration": 5.000342851,
            "cycle": 0,
            "count": 3880000,
            "avg": 0.0000012887481574742268,
            "rps": 775946.7931732028,
            "percent": -0.05661803743224425
          }
        }
      ]
    },
    {
      "name": "Call with middlewares",
      "tests": [
        {
          "name": "No middlewares",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.001120158,
            "cycle": 0,
            "count": 3948000,
            "avg": 0.000001266747760385005,
            "rps": 789423.1442699122,
            "percent": 0
          }
        },
        {
          "name": "5 middlewares",
          "stat": {
            "duration": 5.00128085,
            "cycle": 0,
            "count": 3392000,
            "avg": 0.0000014744342128537735,
            "rps": 678226.2587792885,
            "percent": -14.085840565703535
          }
        }
      ]
    },
    {
      "name": "Call with statistics & metrics",
      "tests": [
        {
          "name": "No statistics",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.000442216,
            "cycle": 0,
            "count": 3481000,
            "avg": 0.000001436495896581442,
            "rps": 696138.4312894938,
            "percent": 0
          }
        },
        {
          "name": "With metrics",
          "stat": {
            "duration": 5.013518841,
            "cycle": 0,
            "count": 358000,
            "avg": 0.000014004242572625698,
            "rps": 71406.93220743797,
            "percent": -89.74242348965461
          }
        },
        {
          "name": "With statistics",
          "stat": {
            "duration": 5.000931799,
            "cycle": 0,
            "count": 2823000,
            "avg": 0.0000017714955008855828,
            "rps": 564494.8008618103,
            "percent": -18.91055349204511
          }
        },
        {
          "name": "With metrics & statistics",
          "stat": {
            "duration": 5.007962774,
            "cycle": 0,
            "count": 379000,
            "avg": 0.000013213622094986809,
            "rps": 75679.47628677801,
            "percent": -89.12867428586108
          }
        }
      ]
    },
    {
      "name": "Remote call with FakeTransporter",
      "tests": [
        {
          "name": "Remote call echo.reply",
          "fastest": true,
          "stat": {
            "duration": 5.029613963,
            "cycle": 0,
            "count": 140000,
            "avg": 0.00003592581402142857,
            "rps": 27835.13824915791,
            "percent": 0
          }
        }
      ]
    }
  ],
  "timestamp": 1492547872099,
  "generated": "Tue Apr 18 2017 20:37:52 GMT+0000 (UTC)",
  "elapsedMs": 46871
}
  
PR detailed results
{
  "name": "Moleculer common benchmarks",
  "suites": [
    {
      "name": "Local call",
      "tests": [
        {
          "name": "broker.call (normal)",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.001831524,
            "cycle": 0,
            "count": 4309000,
            "avg": 0.0000011607870791366906,
            "rps": 861484.4341166578,
            "percent": 0
          }
        },
        {
          "name": "broker.call (with params)",
          "stat": {
            "duration": 5.000483466,
            "cycle": 0,
            "count": 3674000,
            "avg": 0.000001361046125748503,
            "rps": 734728.9567060433,
            "percent": -14.713612038804385
          }
        }
      ]
    },
    {
      "name": "Call with middlewares",
      "tests": [
        {
          "name": "No middlewares",
          "reference": true,
          "stat": {
            "duration": 5.001261285,
            "cycle": 0,
            "count": 3756000,
            "avg": 0.0000013315392132587859,
            "rps": 751010.5523311006,
            "percent": 0
          }
        },
        {
          "name": "5 middlewares",
          "fastest": true,
          "stat": {
            "duration": 4.999753187,
            "cycle": 0,
            "count": 4312000,
            "avg": 0.0000011594974923469386,
            "rps": 862442.5724077248,
            "percent": 14.83761043446654
          }
        }
      ]
    },
    {
      "name": "Call with statistics & metrics",
      "tests": [
        {
          "name": "No statistics",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 4.999708416,
            "cycle": 0,
            "count": 4528000,
            "avg": 0.000001104175886925795,
            "rps": 905652.8147740687,
            "percent": 0
          }
        },
        {
          "name": "With metrics",
          "stat": {
            "duration": 5.001937936,
            "cycle": 0,
            "count": 376000,
            "avg": 0.000013303026425531915,
            "rps": 75170.86473501577,
            "percent": -91.6998143760235
          }
        },
        {
          "name": "With metrics & statistics",
          "stat": {
            "duration": 5.008971667,
            "cycle": 0,
            "count": 394000,
            "avg": 0.000012713126058375635,
            "rps": 78658.8597806896,
            "percent": -91.31467837370853
          }
        }
      ]
    },
    {
      "name": "Remote call with FakeTransporter",
      "tests": [
        {
          "name": "Remote call echo.reply",
          "fastest": true,
          "stat": {
            "duration": 5.030823524,
            "cycle": 0,
            "count": 102000,
            "avg": 0.00004932179925490196,
            "rps": 20275.01054517213,
            "percent": 0
          }
        }
      ]
    }
  ],
  "timestamp": 1492547972601,
  "generated": "Tue Apr 18 2017 20:39:32 GMT+0000 (UTC)",
  "elapsedMs": 41663
}
  

@icebob icebob merged commit 8599f7d into master Apr 18, 2017
@icebob icebob deleted the context-meta branch April 18, 2017 20:48
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.

None yet

3 participants