Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions bagels.db

Large diffs are not rendered by default.

Binary file added labreports/.DS_Store
Binary file not shown.
90 changes: 90 additions & 0 deletions labreports/LAB_jk1595.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Lab Report Template for CIS411_Lab3

Course: Messiah College CIS 411, Fall 2018<br/>
Instructors: [Joel Worrall](https://github.com/tangollama) & [Trevor Bunch](https://github.com/trevordbunch)<br/>

Name: Joshua Keong<br/>

GitHub: [jk1595](https://github.com/jk1595)<br/>

# Step 1: Fork this repository

- The URL of my forked repository

https://github.com/jk1595/cis411_lab3.git

# Step 2: Clone your forked repository from the command line

- My GraphQL response from adding myself as an account on the test project

```
{
"data": {
"mutateAccount": {
"id": "4f1689fb-c63b-4825-ad20-d1eadfb8fd57",
"name": "Joshua Keong",
"email": "[email protected]"
}
}
}
```

# Step 3: Signup for and configure New Relic

- The chosen name of your New Relic `app_name` configuration

```
app_name: ['cislab']
```

# Step 4: Exercising the application / generating performance data

_Note: No lab notes required._

# Step 5: Explore your performance data

- What are your observations regarding the performance of this application?

Some queries took longer than others to run. There was a 16.90% error rate, a CPU usage of 3% and 120MB of memory used. Out of the seven queries that were run on the application, two of them took very long to process. The time taken was very much higher than the other 5 queries.

- Is performance even or uneven?

The performance is uneven.

- Between queries and mutations, what requests are less performant?

The two least performant requests were the ones searching for orders containing 'PA' and 'everything'.

- Among the less performant requests, which ones are the most problematic?

The most problematic request was the 6th one when it requested for orders that contained the word 'everything'.

# Step 6: Diagnosing an issue based on telemetry data

- Within the transactions you're examining, what segment(s) took the most time?

The segments that took the longest time was the 'Remainder' and "queryOrdersBySearchTerm" segments that took 51100ms and 3180ms respectively.

- Using New Relic, identify and record the least performant request(s).

The least performant request is the 6th one where it requested for orders that contained the word 'everything'. It took a total time of 56000ms to process the request.

- Using the Transaction Trace capability in New Relic, identify which segment(s) in that request permiatation is/are the most problematic and record your findings.

The most problematic segment was the 'Remainder' segment that took 51100ms (91%) of the 56000ms.

- Recommend a solution for improving the performance of those most problematic request(s) / permiatation(s).

Performance goals should be clearly defined before any code is being written. This will ensure that the performance goal is constantly met throughout development.

# Step 7: Submitting a Pull Request

_Note: No lab notes required._

# Step 8: [EXTRA CREDIT] Address the performance issue(s)

For the purposes of gaining 25% extra credit on the assignment, perform any of the following:

1. Adjust the diagnosed slow call(s) to improve performance.
2. Verify the improved performance in New Relic, **including data and/or screenshots in your lab report**.
3. Check in those changes and **note your solution(s)** in your lab report.
53 changes: 53 additions & 0 deletions newrelic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"use strict";
/**
* New Relic agent configuration.
*
* See lib/config/default.js in the agent distribution for a more complete
* description of configuration variables and their potential values.
*/
exports.config = {
/**
* Array of application names.
*/
app_name: ["cislab"],
/**
* Your New Relic license key.
*/
license_key: "82b466cf496ab31e617e71927322a47c56bdNRAL",
logging: {
/**
* Level at which to log. 'trace' is most useful to New Relic when diagnosing
* issues with the agent, 'info' and higher will impose the least overhead on
* production applications.
*/
level: "info",
},
/**
* When true, all request headers except for those listed in attributes.exclude
* will be captured for all traces, unless otherwise specified in a destination's
* attributes include/exclude lists.
*/
allow_all_headers: true,
attributes: {
/**
* Prefix of attributes to exclude from all destinations. Allows * as wildcard
* at end.
*
* NOTE: If excluding headers, they must be in camelCase form to be filtered.
*
* @env NEW_RELIC_ATTRIBUTES_EXCLUDE
*/
exclude: [
"request.headers.cookie",
"request.headers.authorization",
"request.headers.proxyAuthorization",
"request.headers.setCookie*",
"request.headers.x*",
"response.headers.cookie",
"response.headers.authorization",
"response.headers.proxyAuthorization",
"response.headers.setCookie*",
"response.headers.x*",
],
},
};
34 changes: 34 additions & 0 deletions newrelic_agent.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-24T11:18:55.692Z","msg":"Using New Relic for Node.js. Agent version: 4.9.0; Node version: v13.9.0."}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-24T11:18:55.694Z","msg":"New Relic for Node.js 4.9.0 has not been tested on Node.js v13.9.0. Please update the agent or downgrade your version of Node.js"}
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-24T11:18:55.873Z","msg":"Not adding native metric sampler.","component":"sampler","error":{"message":"Cannot find module '@newrelic/native-metrics'\nRequire stack:\n- /Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/lib/sampler.js\n- /Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/lib/agent.js\n- /Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/index.js\n- /Users/joshuakeong/Documents/GitHub/cis411_lab3/server.js","stack":"Error: Cannot find module '@newrelic/native-metrics'\nRequire stack:\n- /Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/lib/sampler.js\n- /Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/lib/agent.js\n- /Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/index.js\n- /Users/joshuakeong/Documents/GitHub/cis411_lab3/server.js\n at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)\n at Function.wrappedResolveFilename [as _resolveFilename] (/Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/lib/shimmer.js:359:39)\n at Function.Module._load (internal/modules/cjs/loader.js:862:27)\n at Function.wrappedLoad [as _load] (/Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/lib/shimmer.js:365:38)\n at Module.require (internal/modules/cjs/loader.js:1040:19)\n at require (internal/modules/cjs/helpers.js:72:18)\n at Object.start (/Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/lib/sampler.js:165:32)\n at Agent.start (/Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/lib/agent.js:138:11)\n at createAgent (/Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/index.js:147:9)\n at initialize (/Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/index.js:75:15)"}}
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-24T11:18:55.873Z","msg":"Starting New Relic for Node.js connection process."}
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-24T11:19:01.670Z","msg":"Reporting to: https://rpm.newrelic.com/accounts/2697688/applications/662001973","component":"new_relic_response"}
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-24T11:19:01.671Z","msg":"Connected to collector-007.newrelic.com:443 with agent run ID BRggQuujHSMAACkp2Cd1WTdeosucAAgBAAAnIQEAAAvDAgQndVk1AwAFNC45LjAAG0pvc2h1YXMtTWFjQm9vay1Qcm8tMy5sb2NhbAAGY2lzbGFi.","component":"collector_api"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-24T11:26:03.630Z","msg":"transaction WebTransaction/Expressjs/POST// (f0e8e9897b5a18) contained 1756 segments, only collecting the first 900","component":"Harvest"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-24T11:28:24.678Z","msg":"transaction WebTransaction/Expressjs/POST// (107d4beddfb75d0) contained 14235 segments, only collecting the first 900","component":"Harvest"}
{"v":0,"level":50,"name":"newrelic","hostname":"collector-007.newrelic.com","pid":3011,"time":"2020-04-25T07:37:11.607Z","msg":"Calling metric_data on New Relic failed unexpectedly. Data will be held until it can be submitted:","component":"collector_api","errno":-3008,"code":"ENOTFOUND","syscall":"getaddrinfo","stack":"Error: getaddrinfo ENOTFOUND collector-007.newrelic.com\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:26)","message":"getaddrinfo ENOTFOUND collector-007.newrelic.com"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T07:37:11.653Z","msg":"Merging 0 (of 0) errors for next delivery.","component":"error_tracer"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T07:37:11.654Z","msg":"Merging 0 of 0 events into ErrorAggregator for next harvest","component":"event_aggregator"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T07:37:11.656Z","msg":"Merging 0 of 0 events into SpanAggregator for next harvest","component":"event_aggregator"}
{"v":0,"level":30,"name":"newrelic","hostname":"collector-007.newrelic.com","pid":3011,"time":"2020-04-25T07:37:11.657Z","msg":"Error on submission to New Relic (data held for redelivery):","errno":-3008,"code":"ENOTFOUND","syscall":"getaddrinfo","stack":"Error: getaddrinfo ENOTFOUND collector-007.newrelic.com\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:26)","message":"getaddrinfo ENOTFOUND collector-007.newrelic.com"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T08:10:38.604Z","msg":"transaction WebTransaction/Expressjs/POST// (567bc7fe63ff98) contained 1756 segments, only collecting the first 900","component":"Harvest"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T08:41:39.171Z","msg":"transaction WebTransaction/Expressjs/POST// (7f9e4890db01dc) contained 14235 segments, only collecting the first 900","component":"Harvest"}
{"v":0,"level":50,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T11:02:05.136Z","msg":"Calling metric_data on New Relic failed unexpectedly. Data will be held until it can be submitted:","component":"collector_api","errno":-50,"code":"ENETDOWN","syscall":"connect","address":"162.247.242.27","port":443,"stack":"Error: connect ENETDOWN 162.247.242.27:443 - Local (192.168.1.114:56738)\n at internalConnect (net.js:921:16)\n at defaultTriggerAsyncIdScope (internal/async_hooks.js:313:12)\n at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1063:9)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:10)","message":"connect ENETDOWN 162.247.242.27:443 - Local (192.168.1.114:56738)"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T11:02:05.137Z","msg":"Merging 0 (of 0) errors for next delivery.","component":"error_tracer"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T11:02:05.137Z","msg":"Merging 0 of 0 events into ErrorAggregator for next harvest","component":"event_aggregator"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T11:02:05.137Z","msg":"Merging 0 of 0 events into SpanAggregator for next harvest","component":"event_aggregator"}
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T11:02:05.137Z","msg":"Error on submission to New Relic (data held for redelivery):","errno":-50,"code":"ENETDOWN","syscall":"connect","address":"162.247.242.27","port":443,"stack":"Error: connect ENETDOWN 162.247.242.27:443 - Local (192.168.1.114:56738)\n at internalConnect (net.js:921:16)\n at defaultTriggerAsyncIdScope (internal/async_hooks.js:313:12)\n at GetAddrInfoReqWrap.emitLookup [as callback] (net.js:1063:9)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:10)","message":"connect ENETDOWN 162.247.242.27:443 - Local (192.168.1.114:56738)"}
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T13:36:00.984Z","msg":"The New Relic collector requested a connection restart on metric_data:","component":"collector_api","statusCode":200,"class":"NewRelic::Agent::ForceRestartException","stack":"Error: Periodic restart request\n at StreamSink.parser [as callback] (/Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/lib/collector/parse-response.js:81:25)\n at StreamSink.end (/Users/joshuakeong/Documents/GitHub/cis411_lab3/node_modules/newrelic/lib/util/stream-sink.js:43:8)\n at IncomingMessage.onend (_stream_readable.js:673:10)\n at Object.onceWrapper (events.js:427:28)\n at IncomingMessage.emit (events.js:333:22)\n at endReadableNT (_stream_readable.js:1201:12)\n at processTicksAndRejections (internal/process/task_queues.js:84:21)","message":"Periodic restart request"}
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T13:36:02.211Z","msg":"Disconnected from New Relic; clearing run ID BRggQuujHSMAACkp2Cd1WTdeosucAAgBAAAnIQEAAAvDAgQndVk1AwAFNC45LjAAG0pvc2h1YXMtTWFjQm9vay1Qcm8tMy5sb2NhbAAGY2lzbGFi.","component":"collector_api"}
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T13:36:06.596Z","msg":"Reporting to: https://rpm.newrelic.com/accounts/2697688/applications/662001973","component":"new_relic_response"}
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T13:36:06.596Z","msg":"Connected to collector-007.newrelic.com:443 with agent run ID BUa7dVrSR7MqACkp2Cd1WTdepD04AAgBAAAnIQEAAAvDAgQndVk1AwAFNC45LjAAG0pvc2h1YXMtTWFjQm9vay1Qcm8tMy5sb2NhbAAGY2lzbGFi.","component":"collector_api"}
{"v":0,"level":50,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T14:32:20.225Z","msg":"Calling metric_data on New Relic failed unexpectedly. Data will be held until it can be submitted:","component":"collector_api","errno":-54,"code":"ECONNRESET","syscall":"read","stack":"Error: read ECONNRESET\n at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27)","message":"read ECONNRESET"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T14:32:20.227Z","msg":"Merging 0 (of 0) errors for next delivery.","component":"error_tracer"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T14:32:20.227Z","msg":"Merging 0 of 0 events into ErrorAggregator for next harvest","component":"event_aggregator"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T14:32:20.227Z","msg":"Merging 0 of 0 events into SpanAggregator for next harvest","component":"event_aggregator"}
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T14:32:20.227Z","msg":"Error on submission to New Relic (data held for redelivery):","errno":-54,"code":"ECONNRESET","syscall":"read","stack":"Error: read ECONNRESET\n at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27)","message":"read ECONNRESET"}
{"v":0,"level":50,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T14:38:11.248Z","msg":"Calling metric_data on New Relic failed unexpectedly. Data will be held until it can be submitted:","component":"collector_api","errno":-54,"code":"ECONNRESET","syscall":"read","stack":"Error: read ECONNRESET\n at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27)","message":"read ECONNRESET"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T14:38:11.248Z","msg":"Merging 0 (of 0) errors for next delivery.","component":"error_tracer"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T14:38:11.248Z","msg":"Merging 0 of 0 events into ErrorAggregator for next harvest","component":"event_aggregator"}
{"v":0,"level":40,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T14:38:11.248Z","msg":"Merging 0 of 0 events into SpanAggregator for next harvest","component":"event_aggregator"}
{"v":0,"level":30,"name":"newrelic","hostname":"Joshuas-MacBook-Pro-3.local","pid":3011,"time":"2020-04-25T14:38:11.248Z","msg":"Error on submission to New Relic (data held for redelivery):","errno":-54,"code":"ECONNRESET","syscall":"read","stack":"Error: read ECONNRESET\n at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27)","message":"read ECONNRESET"}
1 change: 1 addition & 0 deletions node_modules/.bin/jsesc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/newrelic-naming-rules

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/nyc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/parser

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/pbjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/pbts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions node_modules/@apollographql/apollo-tools/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading