CLI 1.2.0: Download artifacts, GraphQL and more!

Profile photo of Michael Dijkstra

Michael Dijkstra

February 21, 2019

To date the Calibre CLI has been used for testing performance following deployments, creating custom reports and dashboards and improving performance workflows. With our latest release you can get even more access to Calibre's features directly from the command line or in your node application.

What's new

Call the Calibre GraphQL API

You can now make direct requests to the GraphQL API which opens up numerous possibilities to integrate Calibre into your delivery pipelines, reporting tools and workflow.

For example, you can read individual metrics with the following query:

1calibre request --query='query GetSite($site: String!) {
2 organisation: {
3 site(slug: $site) {
4 metricsHistory(measurement: $measurement, page: $page) {
5 current
6 oneMonth
7 threeMonth
8 sixMonth
9 }
10 }
11 }
12}' --site='<slug>' --measurement='<metric>' --page='<uuid>'

Or you could update a metric budget to include a new page with the following mutation:

1calibre request --query='mutation UpdateMetricBudget($site: String!, $uuid: String!, $pages: [String!]) {
2 updateMetricBudget(
3 site: $site
4 uuid: $uuid
5 attributes: { pages: $pages }
6 ) {
7 uuid
8 }
9}' --site='<slug>' --uuid='<budget uuid>' --pages='["<page uuid>"]'

You can see the full GraphQL schema in our new API Documentation.


Effortlessly download Lighthouse.json, Screenshots, Render videos and GIFs!

It's now possible to download the artifacts that Calibre generates for each snapshot or one off test.

Snapshots
1calibre site download-snapshot-artifacts --site=<slug> <id>

Downloads the artifacts of a snapshot to ./snapshot-artifacts/<uuid>.

This also generates manifest.json, which makes it possible to programmatically read and use the assets from each test.

One off tests
1calibre test download-artifact <uuid>

Downloads the artifacts of a test to ./test-artifacts/<uuid>


What else has changed


Execute GraphQL queries from Node.js

With the addition of the ability to make GraphQL requests directly to the Calibre API we implemented a new GraphQL module in the node API.

1const { GraphQL } = require('calibre')
2
3const query = `
4 query Site($slug: String!){
5 organisation {
6 site(slug: $slug) {
7 name
8 slug
9 }
10 }
11 }
12 `
13
14const result = GraphQL.request({ query, slug: 'calibre' })

Check out our Node.js examples to see it in action.

Try it out today!

Update existing applications to the latest release with one of the following options:

If you haven't tried the CLI yet, here's a short guide to get you started automating your performance system in no time.

Profile photo of Michael Dijkstra

Michael Dijkstra

Michael is a Platform Developer at Calibre. He's a product-minded developer with more than 10 years experience across the entire product stack. Find him on Twitter or LinkedIn.

Related posts

CLI 1.0.8: Site, page and test profile management

Don’t miss another article

Be notified about new product features, releases and performance research.