⏰ Parikshan – Compiler to measure the running time of javascript functions

Word “parikshan” is originated from Sanskrit language meaning “examine”

Overview of My Submission

Compiles code and wraps function calls in source with Performance hooks.
Reports duration along with details like arguments, calledAt, ret…


This content originally appeared on DEV Community and was authored by Gajanan Patil

Word "parikshan" is originated from Sanskrit language meaning "examine"

Overview of My Submission

  1. Compiles code and wraps function calls in source with Performance hooks.
  2. Reports duration along with details like arguments, calledAt, returnedAt, functionName and location in source code (optional). In case the function returns a promise then finally handler will be attached to the promise and is reported once the finally handler is invoked.
  3. A PerformanceObserver stores the performance entries generated by parikshan in time series collection.
  4. Use this project's MongoDB Charts dashboard file when creating a new dashboard by importing it and connect it to collection created by parikshan.
  5. You can check dashboard for analysis done on botbuilder example repository here.
  6. Check project's README for usage, docs and more information.

Submission Category:

Prime Time

Link to Code

GitHub logo gajananpp / parikshan

⏰ Compiler to measure the running time of javascript functions

⏰ Parikshan

lint test build npm version

Compiler to measure the running time of javascript functions.

InstallationUsageUsing with MongoDBFAQs


Converts

// index.js
greet('John')

To

// output/index.js
const {parikshan} = require("parikshan/build/src/parikshan");

parikshan(greet)('John');

// if compiled with -s flag then compiles to
parikshan(
  greet,
  {"start":{"line":1,"column":0},"end":{"line":1,"column":13},"filename":"index.js"}
)('John')

Installation

To install this package run:

npm i parikshan -D

or with yarn run:

yarn add parikshan -D

Usage

CLI Usage

parikshan  <files..&gt
Compiles code to performance.measure the functions

Positional Arguments:
  files  One or more files or glob patterns to compile

Options:
  -h, --help        Show help                                          [boolean]
  -v, --version     Show version number                                [boolean]
  -o, --output-dir  Output

Additional Resources / Info

Dashboard for analysis done on botbuilder example

Parikshan MongoDB Charts


This content originally appeared on DEV Community and was authored by Gajanan Patil


Print Share Comment Cite Upload Translate Updates
APA

Gajanan Patil | Sciencx (2022-01-13T14:21:10+00:00) ⏰ Parikshan – Compiler to measure the running time of javascript functions. Retrieved from https://www.scien.cx/2022/01/13/%e2%8f%b0-parikshan-compiler-to-measure-the-running-time-of-javascript-functions/

MLA
" » ⏰ Parikshan – Compiler to measure the running time of javascript functions." Gajanan Patil | Sciencx - Thursday January 13, 2022, https://www.scien.cx/2022/01/13/%e2%8f%b0-parikshan-compiler-to-measure-the-running-time-of-javascript-functions/
HARVARD
Gajanan Patil | Sciencx Thursday January 13, 2022 » ⏰ Parikshan – Compiler to measure the running time of javascript functions., viewed ,<https://www.scien.cx/2022/01/13/%e2%8f%b0-parikshan-compiler-to-measure-the-running-time-of-javascript-functions/>
VANCOUVER
Gajanan Patil | Sciencx - » ⏰ Parikshan – Compiler to measure the running time of javascript functions. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/13/%e2%8f%b0-parikshan-compiler-to-measure-the-running-time-of-javascript-functions/
CHICAGO
" » ⏰ Parikshan – Compiler to measure the running time of javascript functions." Gajanan Patil | Sciencx - Accessed . https://www.scien.cx/2022/01/13/%e2%8f%b0-parikshan-compiler-to-measure-the-running-time-of-javascript-functions/
IEEE
" » ⏰ Parikshan – Compiler to measure the running time of javascript functions." Gajanan Patil | Sciencx [Online]. Available: https://www.scien.cx/2022/01/13/%e2%8f%b0-parikshan-compiler-to-measure-the-running-time-of-javascript-functions/. [Accessed: ]
rf:citation
» ⏰ Parikshan – Compiler to measure the running time of javascript functions | Gajanan Patil | Sciencx | https://www.scien.cx/2022/01/13/%e2%8f%b0-parikshan-compiler-to-measure-the-running-time-of-javascript-functions/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.