prisma / prisma-admin-feedback

Feedback for Prisma Admin (currently in invite-only preview)
6 stars 1 forks source link

Performance metrics and query inspection tools #80

Open jhalborg opened 5 years ago

jhalborg commented 5 years ago

Hey,

It'd be great to have more metrics tools - the ones currently live on app.prisma.io is not very helpful

image

There are two things that'd be super awesome:

  1. The ability to see queries made on the Prisma server, and the performance for each.
  2. See the corresponding database query that a prisma query is translated to, to better understand the cause of performance issues.

For example, if I had an app server that made a Prisma query a la

const userDetails = await ctx.db.query.userCredential(
    { where: { email } },
    '{ user { id details { firstName lastName } } }',
  );

it would log query times for this specific request, so that if the resolver that used this query was performing slowly, I could verify if the issue was with my Prisma request or something else.

If it turned out that my Prisma request is slow (for example with many joins in a SQL database), I could inspect the corresponding SQL query that Prisma generates, and consider alternative methods for retrieving the data I need.