diff --git a/afterQuery.png b/afterQuery.png new file mode 100644 index 00000000..cd256019 Binary files /dev/null and b/afterQuery.png differ diff --git a/beforeQuery.png b/beforeQuery.png new file mode 100644 index 00000000..4bd4e592 Binary files /dev/null and b/beforeQuery.png differ diff --git a/labreports/LAB_wesleycqy.md b/labreports/LAB_wesleycqy.md new file mode 100644 index 00000000..ebe19ac7 --- /dev/null +++ b/labreports/LAB_wesleycqy.md @@ -0,0 +1,75 @@ +# Lab Report Template for CIS411_Lab3 +Course: Messiah College CIS 411, Fall 2018
+Instructors: [Joel Worrall](https://github.com/tangollama) & [Trevor Bunch](https://github.com/trevordbunch)
+ +Name: Wesley Chong
+ +GitHub: [wesleycqy](https://github.com/wesleycqy)
+ +# Step 1: Fork this repository +- https://github.com/wesleycqy/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": "08295120-a728-404f-9012-b0e71ec67c29", + "name": "Wesley Chong", + "email": "wc1182@messiah.edu" + } + } +} +``` + +# Step 3: Signup for and configure New Relic +- The chosen name of your New Relic ```cisLab``` 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? +This application has varying performance. Certain queries to the database are very quick and are compeleted in the blink of an eye, while others take up to a minute long. +* Is performance even or uneven? +The performance is uneven. +* Between queries and mutations, what requests are less performant? +The first query and last query are less performant compared to the rest. +* Among the less performant requests, which ones are the most problematic? +The most problematic one was the last query as it returned an error as the customer id was not specified. + +# Step 6: Diagnosing an issue based on telemetry data +* Within the transactions you're examining, what segment(s) took the most time? +* Using New Relic, identify and record the least performant request(s). +The least performant request was the last one that queried for all instances of "gmail.com" +* 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 longest lasting segment was the "remainder" segment, taking up 62,900ms (92%) out of the total time of 68,600ms +* Recommend a solution for improving the performance of those most problematic request(s) / permiatation(s). +Instead of querying the entire database and all of the "columns" within it, we can just query the necessary fields. (Eg. just ID field when looking for customer details or just in items when searching for item characteristics. ) + +# 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. +For the last query: +{ + #all accounts that contain gmail.com + accounts(query: "gmail.com") { + id + email + } +} +#This query searches for all instances of "gmail.com" within account emails, and then outputs their IDs and emails. +2. Verify the improved performance in New Relic, **including data and/or screenshots in your lab report**. +Before: 62,900ms +![beforeQuery](../beforeQuery.png) +After: instant +![afterQuery](../afterQuery.png) +2. Check in those changes and **note your solution(s)** in your lab report. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index cc9fe249..5be3a297 100644 --- a/package-lock.json +++ b/package-lock.json @@ -168,9 +168,9 @@ } }, "@newrelic/koa": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@newrelic/koa/-/koa-1.0.6.tgz", - "integrity": "sha512-V7TR4fMeSjmM6XyT2YDebQ/wQzmVDq+g7Mn3fQItvGWOR+y3kzPoQS7w0hCU6+imPsr3N+GC6Xcj+4EWTHxT3w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@newrelic/koa/-/koa-1.0.8.tgz", + "integrity": "sha512-kY//FlLQkGdUIKEeGJlyY3dJRU63EG77YIa48ACMGZxQbWRd3WZMikyft33f8XScTq6WpCDo9xa0viNo8zeYkg==", "requires": { "methods": "^1.1.2" } @@ -186,9 +186,9 @@ } }, "@newrelic/superagent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@newrelic/superagent/-/superagent-1.0.0.tgz", - "integrity": "sha512-TK5JytA7qk2ZejklCBKCZ8iRe9/8oPtW5xRK5d9pNnXeFZlXXlQ+Pf48q7sdI7vSL9k3EGU1xWI+kQVkIGgI8A==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@newrelic/superagent/-/superagent-1.0.3.tgz", + "integrity": "sha512-lJbsqKa79qPLbHZsbiRaXl1jfzaXAN7zqqnLRqBY+zI/O5zcfyNngTmdi+9y+qIUq7xHYNaLsAxCXerrsoINKg==", "requires": { "methods": "^1.1.2" } @@ -344,9 +344,9 @@ } }, "@tyriar/fibonacci-heap": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@tyriar/fibonacci-heap/-/fibonacci-heap-2.0.8.tgz", - "integrity": "sha512-yujW2S09dkH3uBUiTR5GtMni7LgQS2bSm1ezjugyUzuzM7JUkNvNRMwUL7/bee8gv812zhw1Yw/aIzL47UbTVQ==" + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@tyriar/fibonacci-heap/-/fibonacci-heap-2.0.9.tgz", + "integrity": "sha512-bYuSNomfn4hu2tPiDN+JZtnzCpSpbJ/PNeulmocDy3xN2X5OkJL65zo6rPZp65cPPhLF9vfT/dgE+RtFRCSxOA==" }, "accepts": { "version": "1.3.5", @@ -358,9 +358,9 @@ } }, "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", "requires": { "es6-promisify": "^5.0.0" } @@ -582,11 +582,18 @@ "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", "requires": { - "lodash": "^4.17.10" + "lodash": "^4.17.14" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + } } }, "async-limiter": { @@ -838,13 +845,13 @@ } }, "es6-promise": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", - "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==" + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" }, "es6-promisify": { "version": "5.0.0", - "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "requires": { "es6-promise": "^4.0.3" @@ -1026,11 +1033,11 @@ } }, "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", "requires": { - "agent-base": "^4.1.0", + "agent-base": "^4.3.0", "debug": "^3.1.0" }, "dependencies": { @@ -1043,9 +1050,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, @@ -1219,9 +1226,9 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "nan": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", - "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", "optional": true }, "negotiator": { @@ -1230,9 +1237,9 @@ "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" }, "newrelic": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/newrelic/-/newrelic-4.9.0.tgz", - "integrity": "sha512-02lsCULkqPpZmWdj7XIxoXICgGp/f/KMsPYwrmRT2c/iTvZJvtTCcAYYYyqF708WUe+qVohjI3n7dmUGM+VrHw==", + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/newrelic/-/newrelic-4.13.1.tgz", + "integrity": "sha512-M2o/9vsekKedBfiYtvs1MV5hDBuuqInNYd979luvNoqUZzuCjtNHQ8GPn3b5vDwr4YkmPQD9gfhuX6/id/iuXQ==", "requires": { "@newrelic/koa": "^1.0.0", "@newrelic/native-metrics": "^3.0.0", @@ -1288,6 +1295,7 @@ "version": "0.1.4", "bundled": true, "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -1612,7 +1620,8 @@ "is-buffer": { "version": "1.1.6", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "is-builtin-module": { "version": "1.0.0", @@ -1696,6 +1705,7 @@ "version": "3.2.2", "bundled": true, "dev": true, + "optional": true, "requires": { "is-buffer": "^1.1.5" } @@ -1742,7 +1752,8 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "lru-cache": { "version": "4.1.3", @@ -2008,7 +2019,8 @@ "repeat-string": { "version": "1.6.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "require-directory": { "version": "2.1.1", @@ -2433,9 +2445,9 @@ "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "protobufjs": { "version": "6.8.8", @@ -2516,9 +2528,9 @@ } }, "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", diff --git a/package.json b/package.json index cf7242d0..aa082d14 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "graphql": "^14.0.2", "lodash.startcase": "^4.4.0", "lokijs": "^1.5.5", - "newrelic": "^4.9.0", + "newrelic": "^4.13.1", "uuid": "^3.3.2" }, "devDependencies": {