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

Better remote calls metrics #78

Merged
merged 2 commits into from
Aug 16, 2017
Merged

Better remote calls metrics #78

merged 2 commits into from
Aug 16, 2017

Conversation

icebob
Copy link
Member

@icebob icebob commented Aug 15, 2017

  • removed old unused ctx.targetNodeID
  • fix ctx.remoteCall
  • add ctx.callerNodeID (which nodeID called this remote action)

Output
image

Ping @go4cas

@coveralls
Copy link

coveralls commented Aug 15, 2017

Coverage Status

Coverage increased (+0.0007%) to 99.483% when pulling 40f97ef on ctx_caller_nodeid into f453688 on master.

@benchmark-bot
Copy link

🏁 Benchmark results

📝 Moleculer common benchmarks

⚡ Suite: Local call

Test Master PR Diff %
broker.call (normal) 531,566 664,189 +132,623 Performance: +25%
broker.call (with params) 569,200 649,004 +79,805 Performance: +14%

⚡ Suite: Call with middlewares

Test Master PR Diff %
No middlewares 560,354 618,518 +58,164 Performance: +10%
5 middlewares 570,208 635,015 +64,807 Performance: +11%

⚡ Suite: Call with statistics & metrics

Test Master PR Diff %
No statistics 558,598 626,367 +67,769 Performance: +12%
With metrics 84,854 84,891 +37 Performance: +0%
With statistics 123,189 132,474 +9,286 Performance: +8%
With metrics & statistics 63,456 51,039 -12,417 Performance: -20%

⚡ Suite: Remote call with FakeTransporter

Test Master PR Diff %
Remote call echo.reply 12,109 11,905 -204 Performance: -2%
Master detailed results
{
  "name": "Moleculer common benchmarks",
  "suites": [
    {
      "name": "Local call",
      "tests": [
        {
          "name": "broker.call (normal)",
          "reference": true,
          "stat": {
            "duration": 5.00031745,
            "cycle": 0,
            "count": 2658000,
            "avg": 0.0000018812330511662904,
            "rps": 531566.250858733,
            "percent": 0
          }
        },
        {
          "name": "broker.call (with params)",
          "fastest": true,
          "stat": {
            "duration": 5.000003517,
            "cycle": 0,
            "count": 2846000,
            "avg": 0.0000017568529574841882,
            "rps": 569199.5996250017,
            "percent": 7.079709952517277
          }
        }
      ]
    },
    {
      "name": "Call with middlewares",
      "tests": [
        {
          "name": "No middlewares",
          "reference": true,
          "stat": {
            "duration": 5.000410117,
            "cycle": 0,
            "count": 2802000,
            "avg": 0.000001784586051748751,
            "rps": 560354.0378566112,
            "percent": 0
          }
        },
        {
          "name": "5 middlewares",
          "fastest": true,
          "stat": {
            "duration": 4.999928872,
            "cycle": 0,
            "count": 2851000,
            "avg": 0.0000017537456583654857,
            "rps": 570208.1115525117,
            "percent": 1.75854424706084
          }
        }
      ]
    },
    {
      "name": "Call with statistics & metrics",
      "tests": [
        {
          "name": "No statistics",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.000018125,
            "cycle": 0,
            "count": 2793000,
            "avg": 0.0000017901962495524528,
            "rps": 558597.9750823403,
            "percent": 0
          }
        },
        {
          "name": "With metrics",
          "stat": {
            "duration": 5.008630084,
            "cycle": 0,
            "count": 425000,
            "avg": 0.00001178501196235294,
            "rps": 84853.54136206958,
            "percent": -84.80955084923791
          }
        },
        {
          "name": "With statistics",
          "stat": {
            "duration": 5.000464597,
            "cycle": 0,
            "count": 616000,
            "avg": 0.000008117637332792207,
            "rps": 123188.55339353181,
            "percent": -77.94683137271073
          }
        },
        {
          "name": "With metrics & statistics",
          "stat": {
            "duration": 5.310769787,
            "cycle": 0,
            "count": 337000,
            "avg": 0.000015758960792284868,
            "rps": 63455.96090889262,
            "percent": -88.64013767691534
          }
        }
      ]
    },
    {
      "name": "Remote call with FakeTransporter",
      "tests": [
        {
          "name": "Remote call echo.reply",
          "fastest": true,
          "stat": {
            "duration": 5.037432541,
            "cycle": 0,
            "count": 61000,
            "avg": 0.00008258086132786886,
            "rps": 12109.343302072419,
            "percent": 0
          }
        }
      ]
    }
  ],
  "timestamp": 1502828839578,
  "generated": "Tue Aug 15 2017 20:27:19 GMT+0000 (UTC)",
  "elapsedMs": 47176
}
  
PR detailed results
{
  "name": "Moleculer common benchmarks",
  "suites": [
    {
      "name": "Local call",
      "tests": [
        {
          "name": "broker.call (normal)",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.000083393,
            "cycle": 0,
            "count": 3321000,
            "avg": 0.000001505595722071665,
            "rps": 664188.9222586412,
            "percent": 0
          }
        },
        {
          "name": "broker.call (with params)",
          "stat": {
            "duration": 4.999967949,
            "cycle": 0,
            "count": 3245000,
            "avg": 0.0000015408221722650232,
            "rps": 649004.160246468,
            "percent": -2.2862112726204344
          }
        }
      ]
    },
    {
      "name": "Call with middlewares",
      "tests": [
        {
          "name": "No middlewares",
          "reference": true,
          "stat": {
            "duration": 5.000664174,
            "cycle": 0,
            "count": 3093000,
            "avg": 0.0000016167682424830262,
            "rps": 618517.8393065194,
            "percent": 0
          }
        },
        {
          "name": "5 middlewares",
          "fastest": true,
          "stat": {
            "duration": 5.001455067,
            "cycle": 0,
            "count": 3176000,
            "avg": 0.000001574765449307305,
            "rps": 635015.2020669947,
            "percent": 2.6672412195858612
          }
        }
      ]
    },
    {
      "name": "Call with statistics & metrics",
      "tests": [
        {
          "name": "No statistics",
          "fastest": true,
          "reference": true,
          "stat": {
            "duration": 5.00185631,
            "cycle": 0,
            "count": 3133000,
            "avg": 0.00000159650696137887,
            "rps": 626367.453566454,
            "percent": 0
          }
        },
        {
          "name": "With metrics",
          "stat": {
            "duration": 5.006429948,
            "cycle": 0,
            "count": 425000,
            "avg": 0.000011779835171764706,
            "rps": 84890.83127384647,
            "percent": -86.4471196914065
          }
        },
        {
          "name": "With statistics",
          "stat": {
            "duration": 5.004748749,
            "cycle": 0,
            "count": 663000,
            "avg": 0.000007548640647058824,
            "rps": 132474.18267150258,
            "percent": -78.850404516197
          }
        },
        {
          "name": "With metrics & statistics",
          "stat": {
            "duration": 5.505562241,
            "cycle": 0,
            "count": 281000,
            "avg": 0.0000195927481886121,
            "rps": 51039.292210228596,
            "percent": -91.85154146825197
          }
        }
      ]
    },
    {
      "name": "Remote call with FakeTransporter",
      "tests": [
        {
          "name": "Remote call echo.reply",
          "fastest": true,
          "stat": {
            "duration": 5.039833345,
            "cycle": 0,
            "count": 60000,
            "avg": 0.00008399722241666667,
            "rps": 11905.155566210493,
            "percent": 0
          }
        }
      ]
    }
  ],
  "timestamp": 1502828943011,
  "generated": "Tue Aug 15 2017 20:29:03 GMT+0000 (UTC)",
  "elapsedMs": 47376
}
  

@icebob icebob added this to the 0.10.0 milestone Aug 16, 2017
@icebob icebob merged commit df0c76b into master Aug 16, 2017
@icebob icebob deleted the ctx_caller_nodeid branch August 16, 2017 20:27
@icebob icebob mentioned this pull request Aug 17, 2017
12 tasks
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.

3 participants