HomePhorge

puppetboard/app.py: Optimizing the inventory page

Description

puppetboard/app.py: Optimizing the inventory page

Instead of querying PuppetDB for every fact that it knows about only
querying it for the fact names that it knows about. The result is a
much smaller result set that is more noticable on environments with
large numbers of nodes and/or facts.

On one environment with > 2500 fact-names and 35 nodes a curl test
to the facts endpoint without any query string returned in ~3.5 seconds.
Ran another curl test to the facts endpoint with the query string that
the code in this commit creates, the command finished in ~0.040 seconds.

Details