Skip to content

peopledoc/perfo

Repository files navigation

perfo

perfo is an app that shows build performance from CI providers.

Usage

Prerequisites

You will need the following things properly installed on your computer.

Installation

  • git clone git@github.com:peopledoc/perfo
  • cd perfo
  • yarn

Running

Note that perfo includes not only a front ember app, but also an express server that is used to query CI providers for data and store user preferences.

To reduce strain on external CI APIs (and maybe avoid rate limiting), the server caches data requested from them in a filesystem-based cache. You can control that cache with environment variables.

You will need the following environment variables to run the app:

Optionally, you may also set the following environment variables:

  • PERFO_CACHE_VALIDITY: the server cache validity in milliseconds; defaults to 30 minutes
  • PERFO_CACHE_PRUNE_INTERVAL: the interval at which the whole cache content is checked for validity and expired items are removed; defaults to the cache validity value
  • PERFO_DATA_DIR: the path where the server stores cache and stored data; defaults to a data directory at the project root
  • PERFO_LOG_FORMAT: format for morgan logs; defaults to dev
  • PERFO_MAX_BUILD_AGE: maximum age (in milliseconds) of builds to show data from; defaults to 3 months
  • PERFO_ORG_FILTER: if set, only make projects visible when their org is set to this value; defaults to no filter
  • PERFO_PORT: TCP port the server listens on; only used in production (the development server will always use the port passed to ember serve or 4200 as a default value); defaults to 4200
  • PERFO_ROOT_URL: the root URL where the app is served; defaults to /

Development

Production

You will need a webserver that is capable of serving static files from a directory and proxying requests to a locally-running HTTP server.

  • Build the app: ember build --environment=production
    • make sure the PERFO_ROOT_URL environment is set during the build to the value that will be used when executing the server
    • set up your webserver to serve the dist directory (or whichever directory you told ember build to output into) at the root URL.
  • Run server/standalone.js with node 11+
    • make sure environment variables are set properly
    • make sure the user running the server can read and write into the directory pointed by PERFO_DATA_DIR
    • you may want to use a process manager to ensure it keeps running.
    • set up your webserver to proxy requests that did not hit a static file to where the server is listening (̀localhost:PERFO_PORT).

Custom graphs