npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

apollo_client_performance_test

v1.1.83

Published

<br /> <br /> Tests the response time of your application. A pre requirement is that your application communicates with an graphql api, uses [Apollo Client](https://www.apollographql.com/ "Apollo Client") for sending the queries and [ReactJS](https://re

Downloads

116

Readme

Apollo Client Performance Test

:rocket: Purpose

This library will privide a modal where you can run pre defined performancetests. Each performancetest use your original used apollo client object from the application.

The results can be downloaded as JSON-File after execution of the performancetest.

:heavy_check_mark:Key Points(Pros):

  • :mag_right: Modal ist just visible during your app runns in node_env === 'development'.
  • :wrench: use the same configuration of your apollo client object as production app does.
  • :floppy_disk: download Performancetest data as JSON file.
  • :nut_and_bolt: individual configuration of your performancetests.

Installation

with npm:
npm i apollo_client_performance_test

with yarn:
yarn add apollo_client_performance_test

Usage

import  {PerformanceTestModal, PerformanceTest  }  from  "apollo_client_performance_test";


<PerformanceTestModal  >
	//Performancetest executes Query 100 times. Apollo Cache is ACTIVATED
	<PerformanceTest
		client={client}  
		n={100}  
		fileName="SWFlatQuery.json"  
		withCache  
		query={Query}  
		title="flat query with SW"  />
					  
	//Performancetest executes Query 100 times. Apollo Cache is DEACTIVATED
	<PerformanceTest
		client={client}  
		n={100}  
		fileName="SWNestedtQuery.json"  
		query={Query}  
		title="nested query with SW"  />
	                  
	//Performancetest uses a query with variables
	<PerformanceTest
		client={client}  
		n={100}  
		fileName="SWListQuery.json"  
		query={Query}  
		variables={id: 123}  
		title="List Query with SW"  />
</PerformanceTestModal  >

Modal of Performancetest

Parameters

client: Apollo Client Object to execute the query n: number of iterations the query will requested filename: name of the JSONfile with results withCache: set Apollos cache policy. true=cache-first; false=network-only query: query wich should used in performancetest. Type:DocumentNode(gql``) variables: cariables to give inside the performancetest title: title of the performancetest

JSON Result

[
    {
        "name": "Time for Performancetest",
        "entryType": "measure",
        "startTime": 47627.59999990463,
        "duration": 1402.4000000953674
    },
    {
        "name": "0: Time for Request",
        "entryType": "measure",
        "startTime": 47627.59999990463,
        "duration": 220.70000004768372
    },
    {
        "name": "1: Time for Request",
        "entryType": "measure",
        "startTime": 47848.299999952316,
        "duration": 138.79999995231628
    },
    {
        "name": "2: Time for Request",
        "entryType": "measure",
        "startTime": 47987.200000047684,
        "duration": 113.19999980926514
    },
....
....
....
]