martindstone / pagerduty-cli

A command line interface for PagerDuty
MIT License
91 stars 13 forks source link

Incident list api very slow? #61

Open asportnoy opened 1 year ago

asportnoy commented 1 year ago

This lookup consistently takes around 2 seconds which is not ideal. Would it be possible to speed that up at all?

Screenshot 2023-09-05 at 15 55 30
jcalcada commented 1 year ago

Hi, when I run the command I get it to consistently return within a second. One thought is to use the "since=yesterday" filter to narrow the range for the query. I'm curious, what are you using to capture your "time"?

Here's my output jcalcada@jcalcada-C02F84BLML85 ~ % time pd incident list --me --since=yesterday Getting incidents 1/1 👍, 0/1 👎... done › Error: No incidents found pd incident list --me --since=yesterday 0.61s user 0.20s system 36% cpu 2.209 total jcalcada@jcalcada-C02F84BLML85 ~ % time pd incident list --me
Getting incidents 1/1 👍, 0/1 👎... done › Error: No incidents found pd incident list --me 0.65s user 0.39s system 35% cpu 2.934 total

asportnoy commented 1 year ago

Adding --since=yesterday doesn't give much of an imorovement.

I am using the time command (fish shell, but bash has the same command) to calculate the duration.