# perfole

> code level performance testing tool

Latest version **1.0.4** (published 2023-09-27) · 0 weekly downloads

## Install

```sh
npm install perfole
pnpm add perfole
yarn add perfole
bun add perfole
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-09-27 |
| First published | 2023-09-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 24.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Smiljana Radlovic PR Breeze Testing |
| Maintainers | perfole |
| Keywords | performance |

## Links

- npm: https://www.npmjs.com/package/perfole
- npm.io page: https://npm.io/package/perfole

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.5.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2023-09-27
- 1.0.3 — 2023-09-25
- 1.0.2 — 2023-09-22
- 1.0.1 — 2023-09-20
- 1.0.0 — 2023-09-19

## README

Code level performance measuring tool

## How to use it

#### Import package
const PERFORMANCE_TEST = require('perfole') // CommonJS

import PERFORMANCE_TEST from 'perfole' // ES6


#### Start/stop measurement
```
    PERFORMANCE_TEST.Start({measure:true})
    ...
    PERFORMANCE_TEST.Stop()
```

#### Set action start/end points
```
    PERFORMANCE_TEST.ActionStart({name:"actionName"})
    ...
    PERFORMANCE_TEST.ActionEnd({name:"actionName"})
```

#### Expected methods order
```
PERFORMANCE_TEST.Start(...)  // start measurement first


PERFORMANCE_TEST.ActionStart(...) // anywhere beetwen start/stop measurement
...
PERFORMANCE_TEST.ActionEnd(...) // anywhere beetwen start/stop measurement


PERFORMANCE_TEST.Stop(...) // stop measurement after all action points
```

#### Web Workers (multithreaded)
Since web workers have their own memory space, distinct from the main thread, worker that throws action events must use method CollectActions when receiving message. Example:

```
worker1.on('message', (message) => {
    PERFORMANCE_TEST.CollectActions(message)
});
```

#### Results (get results locally or publish results)

**Locally**
PERFORMANCE_TEST.Stop() is async method that will return list of caught actions in following form:

```
[
  PerfAction {
    actionName: 'actionName',
    startTime: 1695116709310,
    endTime: 1695116710311,
    duration: 1001,
    additionalInfo: '',
    uniqueIdentifier: ''
  }
]
```

**Publish results**
For cloud reporting functionality visit www.perfole.com/languages/cloud.html

## License

This package is proprietary and is subject to certain usage restrictions. Please refer to the license file for more information.

For license details, see LICENSE.txt file that comes with the package

Note: This package utilizes the Axios library for making HTTP requests. Axios is licensed under the MIT License.

---
_Source: https://npm.io/package/perfole · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
